English
Language : 

PIC32MX795F512L-80IPT Datasheet, PDF (22/68 Pages) Microchip Technology – PIC32 Flash Programming Specification
PIC32
8.0 CHECK DEVICE STATUS
Before a device can be programmed, the programmer
must check the status of the device to ensure that it is
ready to receive information.
FIGURE 8-1:
CHECK DEVICE STATUS
Set MCLR low
4-wire
SetMode (6’b011111)
SendCommand (MTAP_SW_MTAP)
SendCommand (MTAP_COMMAND)
statusVal = XferData (MCHP_STATUS)
No
FCBUSY = 0
CFGRDY = 1
Yes
Done
8.1 4-wire Interface
Four-wire JTAG programming is a Mission mode
operation and therefore the setup sequence to begin
programing should be done while asserting MCLR.
Holding the device in Reset prevents the processor
from executing instructions or driving ports.
The following steps are required to check the device
status using the 4-wire interface:
1. Set MCLR pin low.
2. SetMode (6’b011111) to force the Chip TAP
controller into Run Test/Idle state.
3. SendCommand (MTAP_SW_MTAP).
4. SendCommand (MTAP_COMMAND).
5. statusVal = XferData (MCHP_STATUS).
6. If CFGRDY (statusVal<3>) is not ‘1’ and
FCBUSY (statusVal<2>) is not ‘0’ GOTO step 5.
Note:
If using the 4-wire interface, the oscillator
source, as selected by the Configuration
Words, must be present to access flash
memory. In an unprogrammed device, the
oscillator source is the internal FRC allow-
ing for flash memory access. If the Config-
uration Words have been reprogrammed
selecting an external oscillator source
then it must be present for flash memory
access. See the “Special Features”
chapter in the specific device data sheet
for details regarding oscillator selection
using the Configuration Word settings.
8.2 2-wire Interface
The following steps are required to check the device
status using the 2-wire interface:
1. SetMode (6’b011111) to force the Chip TAP
controller into Run Test/Idle state.
2. SendCommand (MTAP_SW_MTAP).
3. SendCommand (MTAP_COMMAND).
4. statusVal = XferData (MCHP_STATUS).
5. If CFGRDY (statusVal<3>) is not ‘1’ and
FCBUSY (statusVal<2>) is not ‘0’, GOTO
step 4.
Note:
If CFGRDY and FCBUSY do not come to
the proper state within 10 ms, the
sequence may have been executed
incorrectly or the device is damaged.
DS61145L-page 22
 2007-2013 Microchip Technology Inc.