Modification (patch) on P89V51RD2 bootloaderThis modification does 2 things:
- does not enter the bootloader mode unless on startup there is a "break" (continouos 0) on the Rx pin for a relatively long time
- when in bootloader mode, it activates a pin when transmitting (to "turn direction" if the device is programmed over a RS485 line)
Disclaimer:The presented program is for TEST PURPOSES ONLY.
In no case should be used for production etc.
Use only at your own risk.
May damage your chip, destroy your boards, your house may catch fire.
Absolutely NO responsibility for any consequences.
Caution:Keep a parallel programmer handy to restore your original bootloader (not necessary, I did without it; only in case something goes wrong).
When finished with this experiment, the original bootloader (downloadable from Philips site) should be restored.
Use only with P89V51RD2 with bootloader version 4 or 5.
- make sure you have bootloader V4 or V5.
- burn the following file into the P89V51RD2 in a conventional way
- disconnect pin p3.4 from any device that may drive it high (it will turn into an output during bootloader action)
- connect to serial, start a suitable terminal program (recommended setting: 9600/8/n/1/no handshake)
- wait at least 400ms
- press U, should write "Patching", detect the proper version of bootloader and write "done".
- notice, now you are unable to enter the bootloader sending U during the first (400)ms; but on receiving the U, the user program (V_TEST1.HEX) starts again, detecting again the bootloader version, but now writing "already patched"
- to enter the bootloader, first set the PC's Tx/RD2's Rx to permanently BREAK (use e.g. realterm.sourceforge.net, it is capable to do it) or do it in a hardware way; reset; BREAK needs to be ON for at least about 140000 cycles (65536 x djnz), which is about 150ms at 12MHz; now release BREAK (a nice edge, no spikes!) and transmit U, it echoes U back - now you are in the bootloader, so you can for example try :020000050002F7 which should return 04 or 05 (the version) and a dot
- notice, that p3.4 is now the "Tx active" (direction turning for RS485) although may need inverting depending on your HW configuration
- now you can erase the user code space (block 0) and burn your own user program, test, play, enjoy
- when finished, burn the "upgrader" for version 5 from the Philips website to revert to the original version - follow the manual given there
wek at efton dot sk 29/12/2004