"Eric Smith" wrote:
Chuck wrote:
> Yup. Nothing like downloading your code into a little 6-pin
> cockroach of a PIC only to find it totally unresponsive. Maybe
> there's a job description for "electronic psychic". "I've
channeled
> your PIC and it says you forgot to set up the TRISIO register, you
> stupid idiot." :)
done that :-)
When people I know do development for the low pin count
devices, they
prototype using a part with a higher pin count, and debug using one
or more of these techniques:
1) in-circuit-debug - two port pins, plus ground and
MCLR (reset) are
used with a Microchip ICD2. Limited usefulness
for debugging things that have to occur in
real time
2) serial I/O - hook up a PC acting as a dumb terminal, and spew
debug messages to it. conceptually same as "printf
debugging"
3) port flags - use one or more GPIO pins as flags to indicate on
a scope or logic analyzer that some internal event
has occurred, or that a particular place in the
code has been reached
4) scope loops - same concept as #3, but specifically used as a trigger
for a scope or logic analyzer for repetitive events,
when it is desired to watch what is happening on
external signals when the event occurs (before,
during, or after)
In addition to the above, I try and run some form of the code in some
form of a simulator first, preferably one to which I can attach code
which acts sort of like the real hardware.
I've done this with Virtex4/PPC & Altera/NIOS lately, as well as ARM, MIPS,
PIC, etc... in the past. It can really save a lot of time.
I did a pic project once with a cs8900 and wired it into the pic
emulator and debugged bootp in simulation. it sure saved a lot of time.
-brad