|
|
|
|
The Bootleg - oops, BootLoad Code.A very quick summary...This code may help those that want to set up a bootloader for a 8051 device. This particular code works for my setup which is something like:
You'll no doubt be aware that while the flash is erasing, or writing a byte, it can't be read from. This means that the CPU must get it's opcodes from somewhere else. You can either use an 87xxx part, with internal eprom space, or plug a ram chip in and wire it somehow. The cpu still needs something to run when it comes out of reset, so I'm not sure how you'd setup the ram solution, hence my preference (amongst many other reasons) for the 87xxx solution. This code compiles with the Hitech C compiler. Other compilers may require adjustments to be made here :( This code hasn't been thoroughly tested as such. The bigger code, from which this has been extracted, was, but I know sometimes bad things happen. Don't burn this into a OTP device until you've tested it !!! Here 'tis...
And now some Delphi...Okay, now that's sorted out, you'll need a little program to download the hex file to the cpu. Here's an extract from a Delphi program that does just that. It's not all there, but you'll hook it into your favourite form easily enough. You will need some serial handling code though. I prefer TSerial2 (shareware) for simple jobs like this, and would strongly recommend TurboPower's Async Pro for serious work. Look at the Delphi Deli for some serial handling code, much of which is freeware. Download a Delphi (object pascal) snippet here. Have fun. (HA!) Contact scott@smartdata.com.au if you get really stuck :) |
|
or Phone: +61 7 3281 8841
|