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

184  THE  ART  OF  DESIGNING EMBEDDED SYSTEMS

                            Next, load just enough parts to test the system’s kernel. This includes
                       the CPU (or maybe a socket if you’re using an ICE), ROM, RAM, and de-
                       coders. Since microprocessor-based systems all use a CPU surrounded by
                       dozens of chips all hanging on a common bus, the failure of any of which
                       can cause problems, it makes sense to bring up your embedded system by
                       testing the simplest sections of the hardware first.
                            Now stop and inspect the board carefully. Look for shorts and opens,
                       and everything that looks a bit odd. Are all of the parts oriented properly?
                       Are the right parts installed in the right locations? It’s hell to find these
                       sorts of  problems by conventional troubleshooting  techniques,  so a few
                       minutes spent inspecting may yield tremendous dividends.
                            Connect power, if at all possible, using a lab supply that has an am-
                       meter. Check the meter: if it’s way out of line of what you’d expect, then
                       something serious is wrong. Stop and find the problem.
                            Now  check the voltage  and stability  of  Vcc on the  target  system.
                       Never neglect this step, and always repeat it if weird, unexplainable things
                       seem to be happening. A +5  supply that is even a half-volt low can cause
                       all sorts of erratic operations that are all but impossible to troubleshoot.
                       Check this with the scope’s vertical channel on the 1 volt per division set-
                       ting so you can measure the supply accurately.
                            Next, check the clock signal to the microprocessor. Clocks are a con-
                       stant source of problems. As processor speeds increase, chip vendors are
                       tightening specs and reducing margins. Yet even now most designers ig-
                       nore the electrical characteristics of this all-important signal. If the CPU
                       uses a crystal instead of a clock module, check the clock-out pin to make
                       sure that it is indeed running at the correct frequency. A PCB layout prob-
                       lem, incorrect cut of crystal, or other problem can make the CPU start at
                       some harmonic of the desired frequency. Again, look at this with the scope
                       on the  1 volt per division setting so you can really see the clock’s shape
                       and voltage levels.
                            Test the CPU’s RESET input next. This critical signal must be in an
                       unasserted state except at power-up and reset time. If RESET is low, some-
                       thing is wrong.
                            With the basic signals correct, it’s time to look at the address and data
                       busses. You’ll have two basic choices: use a tool such as an ICE or BDM,
                       or fudge it with a bit of cleverness. Either way, check every address and
                       data line at each chip.
                            Many ICES and BDMs will let you issue a repeating write command
                       that sends known data to all memory locations. It may be called a “Fill”;
                       tell the tool to fill memory from 0 to infinity, over and over and over. Con-
                        nect a scope to each address line and be sure that they sequence in order.
   192   193   194   195   196   197   198   199   200   201   202