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

1 12  THE ART OF DESIGNING EMBEDDED SYSTEMS


                      nents  because  they  are,  well,  boring.  Who  can  get  worked  up  over
                      the  lowly  carbon resistor?  You can’t even buy  them one at a time any
                      more. At Radio Shack they come paired in bright decorator packages for
                      an outrageous sum.
                           Back when I was in the emulator business we dealt with a lot of user
                      target systems that, because of poor resistor choices, drove the tools out of
                      their  minds. Consider one typical example: a unit  based  on an  8-MHz
                      80188, memory and VO all connected in a carefully thought-out manner.
                      Power and ground distribution were well planned; noise levels were satis-
                      fyingly low. And yet . . . the only tool that seemed to work for debugging
                      code was a logic analyzer. Every emulator the poor designer tested failed
                      to run the code properly. Even a ROM emulator gave erratic results.
                           Though the emulator wouldn’t run the user’s code, it did show an im-
                      mediate service of the non-maskable interrupt-which  wasn’t used in the
                      system. (Note: When things get  weird, always  turn to your emulator’s
                      trace feature, which will capture weirdness like no other tool.)
                           A little further investigation revealed that the NMI input (which is ac-
                      tive high on the 188) was tied low through a 47k resistor.
                           Now, the system ran fine with a ROM and processor on the board. I
                      suppose the  47k  pull-down  was  at  least  technically  legitimate.  A  few
                      microamps of leakage current out of the input pin through 47k yields a nice
                      legal logic zero. Yet this 47k was too much resistance when any sort of
                      tool was installed, because of the inevitable increase in leakage current.
                           Was the  design correct because  it  violated  none of  Intel’s design
                      specs? I maintain that the specs are just the starting point of good design
                      practice. Never, ever, violate one. Never, ever, assume that simply meet-
                      ing spec is adequate.
                           A design is correct only if it reliably satisfies all intended applica-
                      tions-including  the first of all applications, debugging hardware and soft-
                      ware. If  something that is technically correct prevents proper debugging,
                      then there is surely a problem.
                           Pull-down resistors are often a source of trouble. It’s practically im-
                      possible to pull down an LS input (leakage is so high the resistor value must
                      be frighteningly low). Though CMOS inputs leak very little, you must be
                      aware of every potential application of the circuit, including that of plug-
                      ging tools in. The solution is to avoid pull-downs wherever possible.
                           In the case of a critical edge-triggered (read “really noise sensitive”)
                      input such as NMI, you simply should never pull it low. Tie it to ground.
                      Otherwise, switching noise may get coupled into the input. Even worse,
                      every time you lay out the PC board, the magnitude of the noise problem
                      can change as the tracks move around the board.
   120   121   122   123   124   125   126   127   128   129   130