EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Cheap debugging tools, software UART

Started by Jim Stewart March 21, 2011
Bob wrote:
> Jim Stewart wrote: >> Watching all this discussion about debugging >> with an LED and such, I was wondering if anyone >> else writes software UARTS for debug info. >> >> I've written a 9600 baud tx-only UART for >> AVR's in 35 assembly instructions. The data >> out can be inverted so that you can connect >> the tx I/O pin directly to your terminal >> without an inverter or driver. >> >> Timing is by software timing loops so >> interrupts must be off during transmit, >> but I've not found that to be such a big deal. >> >> Add another 100-150 instructions and you can have >> an nice little library of routines to print >> strings, hex and binary. >> >> Works well for me. >> > > I use a timer channel ISR instead of loop timing and I prefer > to use a hardware UART for the debug I/O even if that means I have to > use a software UART for "work" I/O. But that's just my implementation; > having debug I/O is *required* to prevent forcible hair removal. > > Bob
Oh, and the debug port is usually active even in production release. I bring it out to a 4 pin header: Tx, Rx, Vcc, Gnd. The level translators are on a "debug" PCB that is powered by the target. The debug PCBs are so popular (and useful for the test and calibration techs) that I recently had another batch of 20 boards fab-ed. Bob
In article <haCdnUkqm_NwRBXQnZ2dnUVZ5h6dnZ2d@giganews.com>, 
SkiBoyBob@excite.com says...
> > Bob wrote: > > Jim Stewart wrote: > >> Watching all this discussion about debugging > >> with an LED and such, I was wondering if anyone > >> else writes software UARTS for debug info. > >> > >> I've written a 9600 baud tx-only UART for > >> AVR's in 35 assembly instructions. The data > >> out can be inverted so that you can connect > >> the tx I/O pin directly to your terminal > >> without an inverter or driver. > >> > >> Timing is by software timing loops so > >> interrupts must be off during transmit, > >> but I've not found that to be such a big deal. > >> > >> Add another 100-150 instructions and you can have > >> an nice little library of routines to print > >> strings, hex and binary. > >> > >> Works well for me. > >> > > > > I use a timer channel ISR instead of loop timing and I prefer > > to use a hardware UART for the debug I/O even if that means I have to > > use a software UART for "work" I/O. But that's just my implementation; > > having debug I/O is *required* to prevent forcible hair removal. > > > > Bob > Oh, and the debug port is usually active even in production release. I > bring it out to a 4 pin header: Tx, Rx, Vcc, Gnd. The level translators > are on a "debug" PCB that is powered by the target. The debug PCBs are > so popular (and useful for the test and calibration techs) that I > recently had another batch of 20 boards fab-ed. > > Bob
Why build custom transceiver boards? These days the following cables make far more sense. Just provide 1x6 headers on your board at TTL levels of async data flow and have it show up at your PC over a USB virtual COMM port into something like TeraTerm. http://www.mouser.com/ProductDetail/FTDI/TTL-232R-5V/? qs=sGAEpiMZZMtf8aSAtgR7DpPMdam%2fwe00 http://www.mouser.com/ProductDetail/FTDI/TTL-232R-3V3/? qs=sGAEpiMZZMvYU0Oh5y3R5sMdbLgwj41z I've deployed 100s of these cables as test, debug and validation tools and find the cost less than trying to build my own transceiver board. -- Michael Karas Carousel Design Solutions http://www.carousel-design.com

The 2024 Embedded Online Conference