Information

dsPIC33F/PIC24H PROGRAMMING SPECIFICATION
DS70152H-page 30 © 2010 Microchip Technology Inc.
4.3.1 RESPONSE FORMAT
All programming executive responses have a general
format consisting of a two-word header and any
required data for the command.
4.3.1.1 Opcode Field
The opcode is a 4-bit field in the first word of the
response. The opcode indicates how the command
was processed (see Table 4-2). If the command was
processed successfully, the response opcode is PASS.
If there was an error in processing the command, the
response opcode is FAIL and the QE_Code indicates
the reason for the failure. If the command sent to
the programming executive is not identified, the
programming executive returns a NACK response.
4.3.1.2 Last_Cmd Field
The Last_Cmd is a 4-bit field in the first word of
the response and indicates the command that the
programming executive processed. Since the
programming executive can only process one
command at a time, this field is technically not required.
However, it can be used to verify that the programming
executive correctly received the command that the
programmer transmitted.
4.3.1.3 QE_Code Field
The QE_Code is a byte in the first word of the
response. This byte is used to return data for query
commands and error codes for all other commands.
When the programming executive processes one of the
two query commands (QBLANK or QVER), the returned
opcode is always PASS and the QE_Code holds the
query response data. The format of the QE_Code for
both queries is shown in Ta b l e 4 - 3 .
TABLE 4-3: QE_Code FOR QUERIES
When the programming executive processes any
command other than a Query, the QE_Code
represents an error code. Supported error codes are
shown in Ta b l e 4 - 4 . If a command is successfully
processed, the returned QE_Code is set to 0x0, which
indicates that there is no error in the command
processing. If the verify of the programming for the
PROGP or PROGC command fails, the QE_Code is set to
0x1. For all other programming executive errors, the
QE_Code is 0x2.
Field Description
Opcode Response opcode.
Last_Cmd Programmer command that
generated the response.
QE_Code Query code or error code.
Length Response length in 16-bit words
(includes 2 header words).
D_1 First 16-bit data word (if applicable).
D_N Last 16-bit data word (if applicable).
15 12 11 8 7 0
Opcode Last_Cmd QE_Code
Length
D_1 (if applicable)
...
D_N (if applicable)
Query QE_Code
QBLANK 0x0F = Code memory is NOT blank
0xF0 = Code memory is blank
QVER 0xMN, where programming executive
software version = M.N
(i.e., 0x32 means software version 3.2).