When using an in-circuit emulator or debugger to debug your program, some of the device's resources, including memory, are reserved for debugging functions. This applies to Microchip PIC® microcontroller (MCU) and dsPIC® Digital Signal Controller (DSC) devices.
Program Flash
A Debug Executive must be programmed into executable memory in order to perform in-circuit debugging. Some devices use a portion of Program Flash for the debug executive, thus losing some program memory during debug. Other devices (and special -ME2/-ICE/-ICD devices on headers) have dedicated memory for the debug executive, so no application code memory is lost.
Data RAM
The Debug Executive may require data memory to store variables. Some devices use a portion of Data RAM for debug variables, thus losing some data memory during debug. Other devices (and special -ME2/-ICE/-ICD devices on headers) have dedicated data memory for the debug variables, so no data memory is lost.
Stack
The Debug Executive may require access to levels of the stack. Some devices reserve one or two levels of the stack, as well as associated stack registers, thus losing these stack resources during debug. Other devices (and special -ME2/-ICE/-ICD devices on headers) have a dedicated stack, so no resources are lost.
Debug Registers
Some debug features require dedicated debug registers. These are not accessible for general use. Because of their exclusive use for debug, these registers are not found in the device data sheet or programming specification.
If customer access is needed, how to access and use the debug feature register(s) and/or bit(s) are discussed in the documentation for that debug feature. See page "Application In/Out" for an example.
To determine what debug features are supported by device, in MPLAB® X IDE see Help > Release Notes > Debug Features Support.
Reserved Resources by Device
To determine what device memory and other resources are reserved when debugging, in MPLAB X IDE see Help > Release Notes > Reserved Resources.