![Microchip Technology MPLAB PICkit 4 Скачать руководство пользователя страница 15](http://html1.mh-extra.com/html/microchip-technology/mplab-pickit-4/mplab-pickit-4_user-manual_1785690015.webp)
Figure 3-8. Proper Connections for Programming
For programming, no clock is needed on the target device, but power must be supplied. When programming, the
debugger puts programming levels on V
PP
/MCLR, sends clock pulses on PGC, and serial data via PGD. To verify
that the part has been programmed correctly, clocks are sent to PGC and data is read back from PGD. This
sequence confirms the debugger and device are communicating correctly.
3.4
Requirements for Debugging
To debug (set breakpoints, see registers, etc.) with the MPLAB PICkit 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 Micro-B USB cable. Refer to the MPLAB X IDE
Help file titled “Getting Started with MPLAB X IDE,” and navigate through the “Tutorial” to the “Running and
Debugging Code” section.
• The debugger must be connected (as shown in the figure in
PP
, PGC and PGD pins of
the target device with the modular interface cable (or equivalent).
• The target device must have power and a functional, running oscillator. If for any reason, the target device does
not run, the MPLAB PICkit 4 In-Circuit Debugger will not be able to debug.
• 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 selected in the device’s
configuration word settings. 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:
•
3.4.1 Sequence of Operations Leading to Debugging
•
3.4.1
Sequence of Operations Leading to Debugging
Given that the
3.4 Requirements for Debugging
are met, set the MPLAB PICkit 4 In-Circuit Debugger as the current
tool in MPLAB X IDE. Go to
File > Project Properties
to open the dialog, then under “Hardware Tool,” click
PICkit 4
.
The following actions can now be performed.
• 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 high area of program memory of the target device. Since
the debug executive must reside in program memory, the application program must not use this reserved space.
Operation
©
2020 Microchip Technology Inc.
User Guide
DS50002751D-page 15