Debug Tools and Device Memory

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.


The Debug Executive may require access to levels of the stack. Some devices reserve 1 or 2 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. An example is Application In/Out.

To determine what debug features are supported by device, see MPLAB® X IDE Help > Release Notes, MPLAB X IDE Support Documentation, Debug Features Support.

Reserved Resources by Device

To determine what device memory and other resources are reserved when debugging, see MPLAB X IDE Help > Release Notes, MPLAB X IDE Support Documentation, Reserved Resources.

© 2021 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.