Page 164 - The Art of Designing Embedded Systems
P. 164

Troubleshooting Tools  1 5 1


                         Here’s  another tip:  When  you’re using  a  scope, if  a  signal looks
                    weird, maybe there’s something wrong! Avoid the temptation to rational-
                    ize the problem. Instead of blaming the signal on a lousy ground, quickly
                    connect that ground clip and test your assumption.
                         Never accept something that looks awful. Either convince yourself
                    that it’s actually OK, or find the source of the problem.
                         Walk through your lab. You’ll find that most of the digital folks have
                    their vertical amplifiers set to 2 volts/division, which eases displaying two
                    traces simultaneously.  Unfortunately, too many of  us  seem to think the
                    vertical gain knob is welded into position. It’s hard to distinguish a valid
                    zero from one drooling just a little too high with so little resolution. Flip to
                    1 V/division occasionally to make sure that zero is legitimate.
                         Every instrument is a lying beast, a source of both information and
                    disinformation. The scope is no exception. A  100-MHz scope will show
                    even a perfect 50-MHz clock as a sine wave, not in its true square form.
                    Digital scopes exhibiting aliasing sweep too slowly (below the Nyquist
                    limit) for a given signal, and that 50-MHz clock may look like a perfect
                    1 -kHz signal, causing the inexperienced engineer to go crazy searching for
                    a problem that just does not exist. Try this experiment: measure a 10- or
                    20-MHz clock on a digital scope. Crank the sweep rate slower and slower.
                    You’ll  inevitably  reach  a  point  where  the  scope  shows a  near-perfect
                    square wave several orders of magnitudes slower than the actual clock fre-
                    quency. This is an example of aliasing, where the scope’s sampling rate
                    yields an altogether incorrect display. I’m sure many folks have heard a
                    claim such as, “This 16-MHz oscillator is running at 16 kHz! Can you be-
                    lieve it?” Don’t. Check your settings first.
                         We digital folks deal in ones and zeroes . . . and tristates. Each con-
                    dition means something. When troubleshooting, you’ve got to know which
                    of these three (not two) states a node is in. Our best tool is the scope, yet it
                    is inherently incapable of distinguishing the tristate condition.
                         In the good old days of LS technology you could be pretty sure a tri-
                    stated signal would show up at around  1.5 volts-somewhere  between a
                    zero and a one. With CMOS this assurance is gone, yet most engineers
                    blithely continue to assume that zero volts means zero. It just ain’t so.
                         My solution is a little tool I made: a  1 k resistor with a clip lead on
                    each end. Mine is nicely soldered together and covered with insulation to
                    avoid shorts. To tell the difference between a legal state and high imped-
                    ance, clip the tool to the node and alternately touch the other end to Vcc
                    and then ground. If the node moves more than a trifle, something is wrong.
                    The scope, plus my tool, lets me identify all three possible states. Without
   159   160   161   162   163   164   165   166   167   168   169