Given that the requirements for debugging are met, the following actions will be performed when the MPLAB® REAL ICE™ In-Circuit Emulator is set as the hardware tool for your MPLAB X IDE project (File > Project Properties > Hardware Tool category > Real ICE > SN XXXXXX) and Debug > Debug Project is selected.
1
Program Application Code
The application code is programmed into the device’s memory via the In-Circuit Serial Programming™ (ICSP™) protocol, as described in "Emulator Operation".
2
Program Debug Exec
The small Debug Executive program is loaded into the high program memory of the target device. Because the Debug Executive must reside in program memory, the application program must not use this reserved space. Some devices have special memory areas dedicated to the debug executive. Check your device datasheet for details.
To determine the amount of program memory that must be reserved, see the MPLAB X IDE Start Page, Learn & Discover tab, Users Guide & Release Notes > Reserved Resources, and select your device.
3
Enable Debug Features
Special “in-circuit debug” registers in the target device are enabled by MPLAB X IDE. These allow the debug executive to be activated by the emulator.
To determine the registers that must be reserved for debug, see the MPLAB X IDE Start Page, Learn & Discover tab, Users Guide & Release Notes > Reserved Resources, and select your device.
4
Debug Run Program
The target device is run in Debug mode.