Page 212 - Embedded Microprocessor Systems Real World Design
P. 212
During initial debug, disable the watchdog timer, disconnect any nonessential
external systems, and force error sensors to a known state. Minimize the number
of variables.
Debugging in RAM
Chapter 1 described the use of lope analyzers, emulators, and monitor programs
for debugging. Use of debugging breakpoints requires that the code be executed
from RAM. A breakpoint replaces an instruction with different code that executes,
essentially, a software interrupt. Many emulators have internal RAM, and the exter-
nal ROM is ignored when the internal RAM is enabled. The code is loaded into
the emulator RAM and executed there.
Monitor programs must have RAM to set breakpoints. I have worked on systems
where the system RAM was large enough to handle both the RAM requirements
and the program code, so the code was just loaded into system RAM for debug-
ging. In other cases, the PROM was replaced with RAM (the write signal from the
processor must be wired to it) or a second RAM integrated circuit (IC) was added
to the system during development.
ROM emulators contain RAM but plug into a PROM socket. They usually inter-
face to a PC via a serial port and can be loaded from the PC with the target code.
Breakpoints can be downloaded as well. Because most ROMs aren’t socketed any
more, ROM emulators are less popular than they once were.
As processor speeds go up, emulators get harder to build. An emulator typically
consists of some kind of pod that plugs into the processor socket, connected via a
cable to additional emulator hardware, which then connects to a PC that controls
everything. With processor clock rates exceeding 500MHz, it is difficult to get any-
thing to work over any kind of cable. In addition, modern high-integration proces-
sors often come in highdensity surface-mount packages. These parts do not use a
socket, and there is no way to plug in an emulator. With leads on 0.03- or 0.02-inch
or smaller centers, it is nearly impossible to clip anything over the package, A BGA
or PGA package, with the leads underneath the IC, further complicates addition
of any kind of emulator.
The bottom line to all this is that, with increasing processor complexity, devel-
opment tools have regressed from emulators back to software debuggers. Fortu-
nately, some technology improvements make debugging easier. Many processors
include on-chip debugging additions. Intel includes debugging registers on x86
processors from the 386 up. Four registers allow breakpoints to be set for reads,
writes, or any (read/write) access to a specific location. The regsters also allow
8-, 16, or 32-bit memory locations to be monitored. So your debugging software
System Integration and Debug 193