2.5
REQUIREMENTS FOR DEBUGGING
To debug (set breakpoints, see registers, etc.) with the MPLAB ICD 4 In-Circuit
Debugger system, there are critical elements that must be working correctly:
• The debugger must be connected to a computer. It must be powered by the
computer via the USB cable, and it must be communicating with the MPLAB X
IDE software via the USB cable. See
• The target device must have power and a functional, running oscillator. If, for any
reason, the target device does not run, the MPLAB ICD 4 In-Circuit Debugger will
not be able to debug it.
• The target device must have its Configuration words programmed correctly.
These are set using the MPLAB X IDE.
- The oscillator Configuration bits should correspond to RC, XT, etc., depending
on 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.
- For some devices with more than one PGC/PGD pair, the correct pair needs
to be configured. This only refers to debugging, since programming will work
through any PGC/PGD pair.
When the conditions listed above are met, you may proceed to the following:
•
Sequence of Operations Leading to Debugging
•
Debugging Details
2.5.1
Given that the
when the MPLAB ICD 4 In-Circuit Debugger is set as the current tool from the MPLAB
X IDE menu (File>Project Properties):
• When Debug>Debug Main Project is selected, the application code is
programmed into the device's memory via the ICSP protocol as described at the
beginning of this section.
• A small "debug executive" program is loaded into the memory of the target device.
Since some architectures require that 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
data sheet for details.
• 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 debugger. For more
information on the device's reserved resources, see
by the
• The target device is run in Debug mode.
2017 Microchip Technology Inc.
Sequence of Operations Leading to Debugging
Requirements for Debugging
Debugger".
Section 3.3 "Debug Tutorial"
are met, these actions can be performed
Section 2.7 "Resources Used
Operation
for details.
DS50002596A-page 23
Need help?
Do you have a question about the MPLAB ICD 4 and is the answer not in the manual?