English
Language : 

PIC32MX795F512L-80IPT Datasheet, PDF (23/68 Pages) Microchip Technology – PIC32 Flash Programming Specification
9.0 ERASING THE DEVICE
Before a device can be programmed, it must be
erased. The erase operation writes all ‘1s’ to the Flash
memory and prepares it to program a new set of data.
Once a device is erased, it can be verified by
performing a “Blank Check” operation. See
Section 9.1 “Blank Check” for more information.
The procedure for erasing program memory (Program,
Boot, and Configuration memory) consists of selecting
the MTAP and sending the MCHP_ERASE command.
The programmer then must wait for the erase operation
to complete by reading and verifying bits in the
MCHP_STATUS value. Figure 9-1 illustrates the process
for performing a Chip Erase.
Note:
The Device ID memory locations are read-
only and cannot be erased. Therefore,
Chip Erase has no effect on these memory
locations.
FIGURE 9-1:
ERASE DEVICE
Select MTAP
SendCommand (MTAP_SW_MTAP)
Put MTAP in Command Mode
SendCommand (MTAP_COMMAND)
PIC32
The following steps are required to erase a target
device:
1. SendCommand (MTAP_SW_MTAP).
2. SendCommand (MTAP_COMMAND).
3. XferData (MCHP_ERASE).
4. Delay 1 ms.
5. statusVal = XferData (MCHP_STATUS).
6. If CFGRDY (statusVal<3>) is not ‘1’ and
FCBUSY (statusVal<2>) is not ‘0’, GOTO to
step 4.
Note:
The Chip Erase operation is a self-timed
operation. If the FCBUSY and CFGRDY
bits do not become properly set within the
specified Chip Erase time, the sequence
may have been executed incorrectly or
the device is damaged.
9.1 Blank Check
The term “Blank Check” implies verifying that the
device has been successfully erased and has no
programmed memory locations. A blank or erased
memory location always reads as ‘1’.
The device Configuration registers are ignored by the
Blank Check. Additionally, all unimplemented memory
space should be ignored from the Blank Check.
Issue Chip Erase Command
XferData (MCHP_ERASE)
1 millisecond Delay
Read Erase Status
statusVal = XferData (MCHP_STATUS)
No
FCBUSY = 0
CFGRDY = 1
Yes
Done
 2007-2013 Microchip Technology Inc.
DS61145L-page 23