English
Language : 

PIC32MX795F512L-80IPT Datasheet, PDF (32/68 Pages) Microchip Technology – PIC32 Flash Programming Specification
PIC32
16.0 THE PROGRAMMING
EXECUTIVE
Note:
The Programming Executive (PE) is included
with your installation of MPLAB® IDE. To
download the appropriate PE file for your
device, please visit the related product page
on the Microchip web site.
16.1 PE Communication
The programmer and the PE have a master-slave
relationship, where the programmer is the master
programming device and the PE is the slave.
All communication is initiated by the programmer in the
form of a command. The PE is able to receive only one
command at a time. Correspondingly, after receiving
and processing a command, the PE sends a single
response to the programmer.
16.1.1 2-WIRE ICSP EJTAG RATE
In Enhanced ICSP mode, the PIC32 family devices
operate from the internal Fast RC oscillator, which has
a nominal frequency of 8 MHz.
16.1.2 COMMUNICATION OVERVIEW
The programmer and the PE communicate using the
EJTAG Address, Data and Fastdata registers. In partic-
ular, the programmer transfers the command and data
to the PE using the Fastdata register. The programmer
receives a response from the PE using the Address
and Data registers. The pseudo operation of receiving
a response is shown in the GetPEResponse pseudo
operation below:
Format:
response = GetPEResponse()
Purpose:
Enables the programmer to receive the 32-bit
response value from the PE.
EXAMPLE 16-1: GetPEResponse EXAMPLE
WORD GetPEResponse()
{
WORD response;
// Wait until CPU is ready
SendCommand(ETAP_CONTROL);
// Check if Proc. Access bit (bit 18) is set
do {
controlVal=XferData(32’h0x0004C000 );
} while( PrAcc(contorlVal<18>) is not ‘1’ );
// Select Data Register
SendCommand(ETAP_DATA);
// Receive Response
response = XferData(0);
// Tell CPU to execute instruction
SendCommand(ETAP_CONTROL);
XferData(32’h0x0000C000);
// return 32-bit response
return response;
}
The typical communication sequence between the
programmer and the PE is shown in Table 16-1.
The sequence begins when the programmer sends the
command and optional additional data to the PE, and
the PE carries out the command.
When the PE has finished executing the command, it
sends the response back to the programmer.
The response may contain more than one response.
For example, if the programmer sent a READ
command, the response will contain the data read.
TABLE 16-1: COMMUNICATION
SEQUENCE FOR THE PE
Operation
Operand
Step 1: Send command and optional data from
programmer to the PE.
XferFastData
XferFastData..
(Command | data len)
optional data..
Step 2: Programmer reads the response from the PE.
GetPEResponse
GetPEResponse...
response
response...
DS61145L-page 32
 2007-2013 Microchip Technology Inc.