Least intrusive debugging...
groggory
Posts: 205
For all the programs that my friend and I have written so far we have always used the Full Duplex Serial Driver as a debug port during dev. However, during some time sensitive things enabling our debug lines of code really slowed things down. Would moving to a video driver (Composite or VGA) instead of serial be a faster and less intrusive way to do debugging? It seems like it might being that the propeller has hardware video hardware in each cog.
Any thoughts?
Any thoughts?
Comments
1) Keep your debug strings very short
2) Increase the size of the output buffer and/or increase the Baud
3) Switch to using a TV or VGA display for the debugging. Normally the display buffer can get fairly large and the TV needs at least 3 I/O pins or VGA needs typically 8 I/O pins. There is a 1-pin TV driver in the Object Exchange and there is a TV driver used in Sphinx that keeps its display buffer in the cog's memory. It still takes some time to handle the display of debugging information, particularly when the display screen is rolled up.
A TV driver like Bagger's Half-Height TV Text objects will give you more display area for debug info.
A scrolling window in half the display would not be too hard to make ... just look at the way new-line works.
My zero footprint debugger is also in the obex. It uses the shadow ram in cog to step through the program, but it slows the cog quite dramatically. It is a little complex to use, but can also trace spin and even switch the pasm debugging on for the spin interpreter.
Output the debug data to a monitor, also sometimes outputting audio
alerts is useful...especially if while working on the circuit under test you
are unable to easily watch a monitor. You need not limit the audio alerts
to simple beeps as the prop is capable of playing good quality audio clips.
You can log the debug data in the eeprom or an sd if there is a lot of it.
You can create a fast routine in a cog and send the external prop debugger
a simple stream of debug data on a single pin. You can also use your
prop tool to monitor all sorts of data from the project under test. The prop
really shines as a custom analyzer....it is truly awesome waht you can do with
it. :-)