Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

© 2006 Microchip Technology Inc. Advance Information DS39716A-page 33-3
Section 33. Programming and Diagnostics
Programm
i
ng
and Diagnostics
33
The internal process is regulated by a state machine built into the PIC24F core logic; however,
overall control of the process must be provided by the external programming device. Microchip
programming devices, such as the MPLAB
®
PM 3 (used with MPLAB IDE software), include the
necessary hardware and algorithms to manage the programming process for PIC24F. Users who
are interested in a more detailed description, or who are considering designing their own
programming interface for PIC24F devices, should consult the appropriate PIC24F device
programming specification.
33.2.3 ICSP and In-Circuit Debugging
ICSP also provides a hardware channel for the In-Circuit Debugger (ICD) which allows externally
controlled debugging of software. Using the appropriate hardware interface and software
environment, users can force the device to single-step through its code, track the actual content
of multiple registers and set software breakpoints.
To use ICD, an external system that supports ICD must load a debugger executive program into
the microcontroller. This is automatically handled by many debugger tools, such as the MPLAB
ICD 2. For PIC24F devices, the program is loaded into the executive program memory, located at
800000h through 8007FFh in the configuration memory space. While memory at these addresses
is implemented, and code can be executed from these addresses, the executive memory space
is not available to the user during normal operating modes.
Because of its location, use of the debugger executive has no impact on the size of the application
being examined. The executive memory space allows the entire program memory to be used for
program code, without needing to leave reserve space for application debugging. In addition, its
use means that the program memory contents in normal and debug states is identical, which helps
to simplify troubleshooting.
In contrast with programming, only one of the ICSP ports may be used for ICD. Depending on the
particular PIC24F device, there may be two or more ICSP ports that can be selected for this
function. The active ICSP debugger port is selected by the ICS Configuration bit(s). For information
on specific devices, refer to the appropriate device data sheet.
33.3 ENHANCED IN-CIRCUIT SERIAL PROGRAMMING
The Enhanced ICSP protocol is an extension of the original ICSP. It uses the same physical
interface as the original, but changes the location and execution of programming control.
ICSP uses a simple state machine to control each step of the programming process; however,
that state machine is controlled by an external programmer. In contrast, Enhanced ICSP uses an
on-board bootloader, known as the program executive, to manage the programming process.
While overall device programming is still overseen by an external programmer, the program
executive manages most of the things that must be directly controlled by the programmer in
standard ICSP.
The program executive implements its own command set, wider in range than the original ICSP,
that can directly erase, program and verify the microcontroller’s program memory. This avoids
the need to repeatedly run ICSP command sequences to perform simple tasks. As a result,
Enhanced ICSP is capable of programming or reprogramming a device more quickly than the
original ICSP.
Like the ICD debugger executive, the program executive does not reside in the user program
space; it is also loaded into the executive program memory (800000h through 8007FFh). Since
the debugger and Enhanced ICSP executives both use this memory space, ICD is not available
while Enhanced ICSP is being used.
The program executive is not preprogrammed into PIC24F devices. If Enhanced ICSP is needed,
the user must use standard ICSP to program the executive to the executive memory space. This
can be done directly by the user, or automatically, using a compatible Microchip programming
system.
For additional information on Enhanced ICSP and the program executive, refer to the appropriate
PIC24F device programming specification.

e-Highlighter

Click to send permalink to address bar, or right-click to copy permalink.

Un-highlight all Un-highlight selectionu Highlight selectionh