Hi,
I can't believe it took me so long to figure this out.
Now I can upgrade the firmware in my PICs (using the MCSP bootloader) without having to wire up the DTR.
The only thing you have to do is make sure that your firmware is constantly looking at the serial port at either 19200 or 115200 baud. When the PIC receives the null character (which has an ASCII value of ZERO) you simply jump to the start of memory and the bootloader code gets run.
Here's an example:
Main:
HSERIN 1, HserinTimedOut, [Char]
IF Char = $00 THEN 'Bootloader must be trying to communicate
CLEAR
@ GOTO 0
END IF
GOSUB DoSomethingWithChar 'jump to your regular data handling routine
HserinTimedOut:
Goto Main
Now, if you're not handling serial port communication all of the time, you are going to have to at least check the receive buffer every second or so to see if the "request-to-send" character has been received (the bootloader software will send if many times).
Also, if you're operating at a different baud rate, you will need to first send the PIC a command to jump to the "Listen for Bootloader" code, which must first change the baud rate to match your bootloader and then listen. This is a bit more complicated.
Anyway, give it a try and let me know how it works for you.
Cheers!
Bookmarks