On-Chip Debugger Specification DS51242A-page 6 ã 2001 Microchip Technology Inc. 1.4 Debugger vs. Emulator Traditionally, embedded systems engineers use in-circuit emulators (ICE) to
develop and debug their designs. The on-chip debug facilities in some
PICmicro devices provide a low cost alternative to a more expensive ICE.
When implemented, the on-chip debugger logic is part of the actual
microcontroller silicon.  As a result, there is a trade-off between the cost of
producing this silicon on every chip (even though only a few will actually use
this logic) and the power of the logic itself.  It would be possible to put an
entire emulator with complex breakpoints and tracing capabilities on a chip,
but the cost would be prohibitively high.  Usually the on-chip debugger
provides the means to set simple breakpoints, query the internal state of the
chip, and single step through code.
A microcontroller utilizing its on-chip debug facilities has these benefits: •  Low cost •  Requires a minimum of extra hardware •  Does not require expensive sockets or adapters •  Able to debug a production line board In order to have the above benefits, on-chip debuggers have these trade-offs
compared to ICEs:
•  Use of some target system resources such as pins, program and/or data memory, and stack space may mean that some portions of an
embedded application cannot be debugged.
•  Triggering and breakpointing are limited to the capabilities of the on- chip debug silicon. •  The target chip must actually be running with a clock and a supply volt- age. Often an emulator probe can run without any external hardware. Overall, an in-circuit emulator usually provides the most powerful debugging
solution, but as chips get faster and more complex, emulators require
increasingly expensive high speed logic and high priced adapters to connect
to the denser chip packages.