I have an application that has a home-grown bootloader which loads a PBP application program. The bootloader needs to be remotely invocable even if the PBP program is defunct or doesn't exist. We implemented this by providing a "long break" detection mechanism. The idea is, if the remote host needs to reload the PIC but the PBP program is kaput, it sends a long break character over the serial link ("Long break" = > 0.5 second space condition). When the long break is received, a "secret handshake" is exchanged by the interrupt handler, and then the bootloader begins to run.
The long break is detected by connecting the Timer1 T1G (timer1 gate) line to the Rxd line. If the Rxd line goes low for more than about .5 second, Timer1 overflows, generates an interrupt, and starts the process.
My problem is in how to implement the interrupt handler in the bootloader. We have to assume that the PBP program might be crashed or non-existant, so the long break interrupt process has to run without any support code in the PBP application. Furthermore, if a spurious break occurs but the handshake doesn't work out, control should be passed back to the PBP program. This means that my self-contained bootloader interrupt handler has to preserve enough of the PBP program's state so that it can return if it's possible to return.
I've studied Darrel's "Instant Interupts" code, but it seems that this requires supporting code in PBP, which might not be there.
Can anyone help??
Joe
Bookmarks