STMicroelectronics SPC572L series Reference Manual page 636

Table of Contents

Advertisement

Embedded Flash Memory (MP55)
} while ( !(tmp & 0x0000_0400) );
status= MCR & 0x0000_0200;/* Check PEG flag */
MCR= 0x0000_0010;/* Reset EHV in MCR: Operation End */
MCR= 0x0000_0000;/* Reset PGM: Deselect Operation */
29.4.5.2
Program Suspend/Resume
The program sequence may be suspended to allow Read access to the flash array. It is not
possible to program or to erase during a Program Suspend. Read-While-Write operations
may also be used to read the array during a program sequence providing the Read is to a
different partition.
During Program Suspend, all reads to the doubleword targeted for program return
indeterminate data.
A Program Suspend can be initiated by changing the value of MCR[PSUS] from '0' to '1'.
MCR[PSUS] can be set to '1' at any time when MCR[PGM] and MCR[EHV] are high and
MCR[ERS] is low. 0–1 transition of MCR[PSUS] causes the module to start the sequence
which places it in Program Suspend.
It is possible to suspend a program performed during an Erase Suspend. The user must
wait until MCR[DONE]=1 before the module is suspended and further actions are
attempted. MCR[DONE] takes no more time than t
to '1'.
Once suspended, the array may be read. Flash memory reads while MCR[PSUS]=1 from
the doubleword being programmed return indeterminate data.
MCR = 0x0000_0019;/* Set PSUS in MCR: Program Suspend */
do
{ tmp = MCR;/* Read MCR */
} while ( !(tmp & 0x0000_0400) );
Note that there is no need to clear MCR.EHV and MCR.PGM in order to perform reads
during program suspend.
The Program sequence is resumed by writing a logic '0' to MCR[PSUS].
MCR[EHV] must be set to '1' before MCR[PSUS] can be cleared to resume the operation.
The module continues the program sequence from one of a set of predefined points. This
may extend the time required for the program operation.
MCR = 0x0000_0011;/* Reset PSUS in MCR: Program Resume */
Repeated suspends at a high frequency may result in the operation timing out, and the
embedded flash memory responds by completing the operation with a fail code (MCR.PEG
= 0). The minimum time between Program Suspends to ensure this does not occur is t
29.4.5.3
Over-programming protection (OPP) enable
Over Programming Protection can be enabled on a block-by-block basis. In an OPP
enabled block, any doubleword which has already been programmed cannot be
programmed again. The OPP enable does not affect the Erase operation. It is possible to
independently set OPP and (hardware) erase protection in order to avoid any kind of
636/2058
Example 5. Doubleword Program Suspend.
/* Loop to wait for DONE=1 */
Example 6. Doubleword Program Resume.
DocID027809 Rev 4
to go high after MCR[PSUS] is set
PSUS
RM0400
.
PSRT

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SPC572L series and is the answer not in the manual?

Questions and answers

Table of Contents