Mon Mar 21 00:09:19 EDT 2011

PIC18 debug mode

See here[1] for a mirror of Jaromir's notes.  From what I gather, the
most useful bits seem to be the fact that debug mode can be entered
from a host signal without any kind of interrupt support on the
target.  The rest is software, and effectively using this already
assumes there is a protocol over RB6 and RB7.

If debug mode is triggered by a 1->0 transition on RB6 (PGC), we can
use this to attach a serial port.  This means a standard serial start
bit can jump to debug.

Anyway, it seems best to use an external clock as Jaromir suggests, to
be independent of clock speed of the PIC.

It seems simplest to use the current size-prefixed command/reply
protocol.  Target can use PGD to signal ready state followed by a
clock-out by the host.

Otoh, I2C is 2-wire.  Maybe that's what I should stick to?

[1] entry://../electronics/20110320-225422