![NXP Semiconductors MPC5605BK Reference Manual Download Page 858](http://html.mh-extra.com/html/nxp-semiconductors/mpc5605bk/mpc5605bk_reference-manual_1721852858.webp)
Chapter 30 Flash Memory
MPC5606BK Microcontroller Reference Manual, Rev. 2
858
Freescale Semiconductor
If during a Modify Operation a reset occurs, the operation is suddenly terminated and the macrocell is reset
to Read Mode. The data integrity of the flash memory section where the Modify Operation has been
terminated is not guaranteed: the interrupted flash memory Modify Operation must be repeated.
In general each modify operation is started through a sequence of three steps:
1. The first instruction is used to select the desired operation by setting its corresponding selection bit
in MCR (PGM or ERS) or UT0 (MRE or EIE).
2. The second step is the definition of the operands: the Address and the Data for programming or the
Sectors for erase or margin read.
3. The third instruction is used to start the modify operation, by setting MCR[EHV] or UT0[AIE].
Once selected, but not yet started, one operation can be canceled by resetting the operation selection bit.
A summary of the available flash memory modify operations is shown in
Once the MCR[EHV] bit (or UT0[AIE]) is set, all the operands can no more be modified until the
MCR[DONE] bit (or UT0[AID]) is high.
In general each modify operation is completed through a sequence of four steps:
1. Wait for operation completion: wait for the MCR[DONE] bit (or UT0[AID]) to go high.
2. Check operation result: check the MCR[PEG] bit (or compare UMISR0-4 with expected value).
3. Switch off FPEC by resetting the MCR[EHV] bit (or UT0[AIE]).
4. Deselect current operation by clearing the MCR[PGM] / MCR[ERS] fields (or UT0[MRE]
/UT0[EIE]).
If the device embeds more than one flash memory module and a modify operation is on-going on one of
them, then it is forbidden to start any other modify operation on the other flash memory modules.
In the following all the possible modify operations are described and some examples of the sequences
needed to activate them are presented.
30.6.2
Double word program
A flash memory program sequence operates on any double word within the flash memory core.
As many as two words within the double word may be altered in a single program operation.
Table 30-57. Flash memory modify operations
Operation
Select bit
Operands
Start bit
Double word program
MCR[PGM]
Address and data by interlock writes
MCR[EHV]
Sector erase
MCR[ERS]
LMS
MCR[EHV]
Array integrity check
None
LMS
UT0[AIE]
Margin read
UT0[MRE]
UT0[MRV] + LMS
UT0[AIE]
ECC logic check
UT0[EIE]
UT0[DSI], UT1, UT2
UT0[AIE]
Summary of Contents for MPC5605BK
Page 2: ...This page is intentionally left blank...
Page 20: ...MPC5606BK Microcontroller Reference Manual Rev 2 20 Freescale Semiconductor...
Page 103: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 103 Clocks and power...
Page 645: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 643 Timers...
Page 715: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 713 ADC system...
Page 787: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 787 Memory...
Page 893: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 893 Integrity...
Page 943: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 943 Debug...