User manual
MPLAB
®
REAL ICE
™
In-Circuit Emulator User’s Guide
DS51616A-page 18 © 2006 Microchip Technology Inc.
• The target device must have its configuration words programmed correctly:
- The oscillator Configuration bits should correspond to RC, XT, etc., depending
upon the target design.
- For some devices, the Watchdog Timer is enabled by default and needs to be
disabled.
- The target device must not have code protection enabled.
- The target device must not have table read protection enabled.
Once the above conditions are met, you may proceed to the following:
• Sequence of Operations Leading to Debug Mode
• Debug Mode Details
2.7.1 Sequence of Operations Leading to Debug Mode
Given that the Requirements For Debug Mode are met, these actions can be
performed when the MPLAB REAL ICE in-circuit emulator is set as the current
debugger (Debugger>Select Tool
):
• When Debugger>Program
is selected, the application code is programmed into
the device’s memory via the ICSP protocol as described above.
• A small “debug executive” program is loaded into the high area of program
memory of the target device. Since the debug executive must reside in program
memory, the application program must not use this reserved space. The debug
executive typically needs about 0x120 words of program memory. Some devices
have special memory areas dedicated to the debug executive. Check your device
data sheet for details.
• Special “in-circuit debug” registers in the target device are enabled. These allow
the debug executive to be activated by the emulator.
• The target device is held in Reset by keeping the V
PP/MCLR line low.
2.7.2 Debug Mode Details
Figure 2-13 illustrates the MPLAB REAL ICE in-circuit emulator system when it is ready
for debugging.
FIGURE 2-13: MPLAB
®
REAL ICE™ IN-CIRCUIT EMULATOR READY FOR
DEBUGGING
+5V
+12V
4.7 k
Ω
4.7 k
Ω
Internal Circuits
Program
Memory
File
Registers
Internal
Debug
Registers
VPP/MCLR
PGC
PGD
1
5
4
Executive
Debug
About 0x10
Bytes Used by
Target
be
Running
must
for Debug
Executive
to Function
Area
VDD
Hardware
Stack Shared
by Debug Exec
Debug Exec
Reserved
for Debug
Executive