Embedded Flash Memory (MP55)
After setting MCR[ERS], one Write (referred to as an Interlock Write) must be performed
before MCR[EHV] can be set to '1'.
The user may terminate the Erase sequence by clearing ERS before setting EHV.
An Erase operation may be aborted by clearing MCR[EHV] assuming MCR[DONE] is low,
MCR[EHV] is high and MCR[ESUS] is low. An Erase Abort forces the module to step 8 of
the Erase sequence. An aborted Erase results in MCR[PEG] being set low, indicating a
failed operation. MCR[DONE] must be checked to know when the aborting command has
completed.
The block(s) being operated on before the Abort contain indeterminate data. This may be
recovered by executing an Erase on the affected blocks. The user may not abort an Erase
sequence while in Erase-Suspend.
MCR= 0x0000_0004;/* Set ERS in MCR: Select Operation */
SEL0= 0x0006_0000;/* Set LSL2-1 in SEL0: Select Blocks */
(0x00_0000)= 0xFFFF_FFFF;/* Latch a Flash Address */
MCR= 0x0000_0005;/* Set EHV in MCR: Operation Start */
do
{ tmp= MCR;/* Read MCR */
} while ( !(tmp & 0x0000_0400) );
status= MCR & 0x0000_0200;/* Check PEG flag */
MCR= 0x0000_0004;/* Reset EHV in MCR: Operation End */
MCR= 0x0000_0000;/* Reset ERS: Deselect Operation */
29.4.5.5.1 Erase Suspend/Resume
The Erase sequence may be suspended to allow Read access to the flash array. It is
possible to program another block in any Flash Memory module during Erase-Suspend.
Programming a location subject to suspended Erase results in the program not being
executed and PEG being set to 0.
It is not possible to erase any block during an Erase-Suspend.
During Erase-Suspend, all reads to blocks targeted for Erase return indeterminate data.
An Erase-Suspend can be initiated by changing the value of MCR[ESUS] from '0' to '1'.
MCR[ESUS] can be set to '1' at any time when MCR[ERS] and MCR[EHV] are high and
MCR[PGM] is low. A 0 to1 transition of MCR[ESUS] causes the module to start the
sequence which places it in Erase-Suspend. The User must wait until MCR[DONE]=1
before the module is suspended and further actions are attempted.
MCR[DONE] takes no longer than t
Once suspended, it is not possible to alter the content of SEL0, SEL1, and SEL2 registers.
Once suspended, the array may be read. Flash memory reads while MCR[ESUS]=1 from
the block(s) being erased return indeterminate data.
MCR= 0x0000_0007;/* Set ESUS in MCR: Erase Suspend */
do
{ tmp= MCR;
638/2058
Example 7. Erase of blocks B0F1 and B0F2.
/* Loop to wait for DONE=1 */
Example 8. Block Erase Suspend.
/* Loop to wait for DONE=1 */
/* Read MCR */
DocID027809 Rev 4
to go high after MCR[ESUS] is set to '1'.
ESUS
RM0400
Need help?
Do you have a question about the SPC572L series and is the answer not in the manual?
Questions and answers