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

174  THE  ART OF  DESIGNING EMBEDDED SYSTEMS



                                On another system the processor’s internal VO lost its con-
                           figuration every few minutes; all of the internal registers changed to
                           default states, yet the program continued to run fine, though all sys-
                           tem I/O was idled.
                                The culprit was again a reset glitch. In this case the pulse was
                           created by  PCB crosstalk.  Only one nanosecond  wide, it was too
                           short to catch reliably on a 500-MHz logic analyzer. We sampled
                           dozens of the erratic resets, eventually creating a statistical view of
                           the glitch.
                                Though every processor  has a minimum reset time  at least
                           several clocks long, even very short glitches can drive CPUs and
                           peripherals into bizarre modes. The trick is identifying the source
                           of  the problem. . . and never ignoring erratic  results or hard-to-
                           diagnose symptoms.
                                Bob Pease, of analog design fame, recommends, “When things
                           are acting funny, measure the amount of funny.”
                                Diagnose all glitches. If the system behaves oddly, something
                           is wrong. Find the problem, or your customer will.




                             Learn to Estimate
                             At the peril of sounding like one of the ancients, I do miss the culture
                         of the slide rule. Though accurate answers might have been elusive, we did
                         learn to estimate the answer for every problem before attempting a solu-
                         tion. Alas, it’s a skill that is fading away.
                             Calculator  abuse-computing  without  thinking-is   now  too  in-
                         grained in our society to waste effort fighting. Bummer. Other instruments,
                         though, also tempt  us to mentally  coast, to do things without thinking.
                        Take the scope: I can’t count the times an engineer mentioned that he sees
                         the signal . . . but has no idea, when I ask, about the width of the pulse. Is
                         it 1 nsec? 1 pec? Perhaps a second wide?
                             Timing is critical in computers, yet too many of us use the scope as a
                         sort of logic probe. “Hey, the signal is there!” Which signal? If you expect
                         a lO-psec pulse every msec, then any deviation from that norm is simply
                         wrong. Know what to expect, and then ensure that the waveforms are ap-
                        proximately correct. A misused scope will generate a morass of misinfor-
                         mation.
                             Estimate the performance of firmware before writing it. Sure, it’s
                        tough to know how many microseconds an as-yet-unwritten function will
   182   183   184   185   186   187   188   189   190   191   192