home  general  lard  emul8or  ArdweeNET  MAXX  the QUUB  Gecko  SiiMAN
        embedded systems  PC software

Pity the embedded programmer without any real tools, no single stepping, no breakpoints, no watch points, no printf() or echo, sometimes not even a LED to flash. How do you see what the value just read from, say the ADC, was?

Below is a screen grab from my logic analyser showing the value 0x4321 being serialised out a single spare IO port by the debug_serout_1_IO() function. Note that it's transmitted LSB first so is reversed.

Well that's a whole lot better that absolutely nothing which is what we often have. But imagine it without the help I've added to the graphic.

Still better than nothing but if we have another spare IO pin we can call debug_serout_2_IO() which will add pulses for every bit so we can see where they are.

Much better and if the call is a one-off that's all we really need. However if the debug call is in a loop that sends a constant stream of serial data it will still be hard to decipher. That's where debug_serout_3_IO() comes in if you have three spare IO pins.

Now the trace on PORTB:2 clearly shows the start and end of the transmission and if there were 100s in a row it will be easy to pick them out.

Get the code debug_serout.txt


Copyright © 1973-2013 Rob Gray, All rights reserved.
PO Box 450, Gin Gin, QLD, Australia.