Flash Array and Control
MPC5510 Microcontroller Family Reference Manual, Rev. 1
22-20
Freescale Semiconductor
Preliminary
2. Write the first address to be programmed in the flash module with the program data. This write is
referred to as a program data interlock write. An interlock write may be either be an aligned word
or doubleword.
3. If more than one word or doubleword is to be programmed, write each additional address in the
page with data to be programmed. This is referred to as a program data write. All unwritten data
words default to 0xFFFF_FFFF.
4. Write a logic 1 to the MCR[EHV] bit to start the internal program sequence or skip to step 9 to
terminate.
5. Wait until the MCR[DONE] bit goes high.
6. Confirm MCR[PEG] = 1.
7. Write a logic 0 to the MCR[EHV] bit.
8. If more addresses are to be programmed, return to step 2.
9. Write a logic 0 to the MCR[PGM] bit to terminate the program sequence.
The program sequence is presented graphically in
. The program suspend operation detailed
Section 22.5.4.1.1, “Flash Program Suspend/Resume
.”
The first write after a program is initiated determines the page address to be programmed. Program may
be initiated with the 0 to 1 transition of the MCR[PGM] bit or by clearing the MCR[EHV] bit at the end
of a previous program. This first write is referred to as an interlock write. If the program is not an
erase-suspended program, the interlock write determines if the shadow or normal array space will be
programmed and causes MCR[PEAS] to be set/cleared.
In the case of an erase-suspended program, the value in MCR[PEAS], is retained from the erase.
An interlock write must be performed before setting MCR[EHV]. The user may terminate a program
sequence by clearing MCR[PGM] prior to setting MCR[EHV].
If multiple writes are done to the same location the data for the last write is used in programming.
While MCR[DONE] is low, MCR[EHV] is high, and MCR[PSUS] is low, the user may clear MCR[EHV],
resulting in a program abort. A program abort forces the module to step 8 of the program sequence. An
aborted program will result in MCR[PEG] being set low, indicating a failed operation. The data space
being operated on before the abort will contain indeterminate data. The user may not abort a program
sequence while in program suspend.
CAUTION
Aborting a program operation will leave the flash core addresses being
programmed in an indeterminate data state. This may be recovered by
executing an erase on the affected blocks.