- Debug Executive
- A small program used in conjunction with your application code to facilitate the on-chip debug process. It is used by all Microchip in-circuit debug tools including the Real ICE, ICD 3, and PICkit 3 as well as the stand-alone starter kits.
The Debug Executive
When using an in-circuit debugger to debug your program, some of the chip's resources are reserved for debugging functions. Your code isn't the only thing that gets programmed into the device. A small program called the debug executive is automatically added to your code when you build and program for debugging. It's job is to run commands sent by the PC and to control the debug process. While your program is running, it sits quietly in the background. However, whenever a breakpoint is reached or a command is received from the PC, control over the device is transferred to the debug executive.
Resource Needs
- Exclusive use of two I/O pins
- Shared control of the MCLR pin
- Some file registers (RAM)
- Some program memory locations (Flash)
- One or two hardware (return) stack locations
For details, select from the MPLAB X Help menu: Help > Help Contents and find the Reserved Resources topic in your debug tool's help section.
The debug executive requires a small amount of code space and a few registers in data memory. The exact amount and locations differ from one device to another and are fully described in the debug tool's help file, accessible from the MPLAB X IDE help menu. In addition to on-chip resources, the ICSP™ lines must be dedicated to the debug process. The I/O pins multiplexed with debug clock, data, and PGM (if used) may not be used by your application while debugging.
Example Resource Needs
| Device | Program Memory Used |
File Registers Used | SW BP Program Memory Used |
SW BP File Registers Used |
| PIC18F4520 | 0x7DC0-0x7FFF | 0x05F4-0x05FF 0x0F9C 0x0FD4 0x0FDB-0x0FDF 0x0FE3-0x0FE7 0x00FEB-0x0FEF 0x0FFD-0x0FFF |
0x7D30-0x7FFF | 0x05EF-0x05FF 0x0F9C 0x0FD4 0x0FDB-0x0FDF 0x0FE3-0x0FE7 0x0FEB-0x0FEF 0x0FFC 0x0FFD-0x0FFF |
| PIC24FJ128GA010 | None | 0x0800-0x081F 0x0820-0x0821 0x0822-0x0823 0x0824-0x0825 0x0826-0x084F |
None | None |
