A UART/SPI Monitor For Your Micro
by Mark Mitchell
Probably the most important thing when trying to debug robot problems or any
microcontroller based systems is VISIBILITY! If you can’t see it you, can’t fix it.
The objective of this project was to create a tool to increase visibility into the
operation of a microcontroller — and ultimately a robot — by getting access through
either the serial port or the SPI port, both of which are pretty ubiquitous fixtures on
most micros.
www.servomagazine.com/index.php?/magazine/article/may2011_Mitchell
Iam sure all microcontroller programmers have used some sort of print statement out a serial port to see what is going on at one time or another. Before in-circuit emulators were available, it was pretty much the
main way of debugging. The SPI port is another place that
one would like to know what is happening, especially when
things are not working properly (which always seems to be
at the most inconvenient time).
To gain better visibility into both of these ports (and
because I was tired of digging around for that serial to RS-
232 board for the thousandth time), I decided to build a
tool that could be used on a standard UART to provide the
tried and true debug printing to a PC. It would also display
the SPI data out (DO) line activity and could inject an SPI
data stream to provide a known good data stream for SPI
data in (DI) exercising. The SPI monitor also allows me to
avoid having to hook up and decode the SPI signals on an
oscilloscope — a tool which may not always be available.
Since this project was pretty small, I decided to build it
using the BoardworX universal prototyping system which
FIGURE 1. Schematic for the
SPI/UART monitor.
A complete kit to go with this article can be
purchased online from the SERVO
Webstore at www.servomagazine.com
or call our order desk at 800-783-4624.
42 SERVO 05.2011