>
> The following idea grew out of recent discussions in the "Re Idea ..."
> thread on PICList. The goal is to come up with something better than
> the equivalent of inserting < printf > statements for debugging code
> where an ICE is not being used.
>
> I invariably develop PIC code as small application modules which execute
> on top of basic monitor code (home-written), consisting of RS-232 comm
> with interactive command capability, including the ability to read/write
> ports, registers, and RAM. I execute routines, and then do "post-mortem"
> analysis by examining RAM/register values, etc.
>
> The basic idea presented here is to define a routine called < watch >,
> which can be called from strategic places in the program (in lieu of
> printf), and which stores selected variables into a circular buffer
> for post-mortem analysis. The circular buffer allows calling < watch >
> in multiple places.
>
> This idea has some advantages: (a) runs relatively fast, compared to
> sending printf during execution; (b) watch var selection can be made
> interactive, with no need to re-assemble to change; (c) watch vars
> can be stored indefinitely into circular buffer without program
> interruption; (d) routines can be left in the final version for
> in-field debugging; (e) idea can be extended for storage of debug
> vars in serial EEPROM (concurrent with datalogging, etc).
>
> Does anyone know if code to do this is available anywhere? If not,
> I'll write it and post to piclist. Does anyone have a better way to
> do what I propose? (short of using an ICE - which wouldn't help out
> with items (d) and (e) anyway).
>
> - Dan Michaels
> Oricom Technologies
>
http://www.sni.net/~oricom
> ===================================