Page 196 - The Art of Designing Embedded Systems
P. 196
Troubleshooting 183
problem comes from a bad data line, chip select, or buffer problem, any of
which is trivial to find with the scope triggered properly.
This example shows how a few seconds of button twiddling can re-
solve two asynchronous signals on the scope display.
When your system seems crashed, it’s often hard to guess exactly
what the program is doing. Is the main loop running correctly? Is it stuck
waiting for input from a UART?
Instead of reaching for the logic analyzer, 1’11 usually put on a think-
ing cap and speculate about what could be going on. For example, in a sys-
tem that regularly polls a UART, it takes but a few seconds to check the
VO port’s chip select to see if the code is hitting that pin. If so, there’s a
pretty good chance the main loop is at least running.
When a series of UO operations happen sequentially you can use de-
layed sweep to examine each event in detail. For instance, the code to pro-
gram a Zilog SCC (Serial Communications Controller-a do-everything
serial link) sends many, many bytes to the same port. Triggering a scope on
these port writes will display a jumble of mixed-up cycles. Delayed sweep,
though, lets you trigger on the first write to the port, and then display the
particular write you’d like to see.
Trigger channel A on the first write. (Use the Trigger Holdoff control
to restrict triggering to burst events.) Set the sweep rate of channel B to
something faster than channel A. Then use the delay time control to scroll
through as many port writes as necessary to find the event causing grief. In
this example, the delayed sweep lets you see a high-resolution view of
events that may be widely separated in time.
Use a variation of this technique to troubleshoot many hardware/
software integration issues. If your system has an unused I/O select-say,
an output of an VO decoder-seed the code with reads or writes to this
port. Trigger time base A from this select, and then use delayed sweep to
zoom in on an enhanced view of problem areas.
Summary-Bringing Up a New System
So there it is, your new creation, now glittering as a real bit of hard-
ware instead of some abstract scribbles on the CAD screen. Flip on the
power switch. . . and surely it’ll continue staring dumbly back at you,
doing nothing, dead and awaiting your magic healing touch. Whatcha
gonna do?
First, before loading the parts, ohm Vcc to GND on the PCB. Any
short means there’s a problem with the board.

