Chapter 4 Memory
MC9S08LG32 MCU Series, Rev. 5
62
Freescale Semiconductor
4.6.3
Program and Erase Command Execution
The FCDIV register must be initialized and any error flag is cleared before beginning command execution.
The command execution steps are:
1. Write a data value to an address in the flash array. The address and data information from this write
is latched into the flash interface. This write is a required first step in any command sequence. For
erase and blank check commands, the value of the data is not important. For page erase commands,
the address may be any address in the 512-byte page of flash to be erased. For mass erase and blank
check commands, the address can be any address in the flash memory. Whole pages of 512 bytes
are the smallest block of flash that may be erased.
NOTE
Do not program any byte in the flash more than once after a successful erase
operation. Reprogramming bits to a byte that is already programmed is not
allowed without first erasing the page in which the byte resides or mass
erasing the entire flash memory. Programming without first erasing may
disturb data stored in the flash.
2. Write the command code for the desired command to FCMD. The five valid commands are blank
check (0x05), byte program (0x20), burst program (0x25), page erase (0x40), and mass erase
(0x41). The command code is latched into the command buffer.
3. Write a 1 to the FCBEF bit in FSTAT to clear FCBEF and launch the command (including its
address and data information).
A partial command sequence can be aborted manually by writing a 0 to FCBEF any time after the
write to the memory array and before writing the 1 that clears FCBEF and launches the complete
command. Aborting a command in this way sets the FACCERR access error flag, which must be
cleared before starting a new command.
A strictly monitored procedure must be obeyed or the command will not be accepted. This
minimizes the possibility of any unintended changes to the flash memory contents. The command
complete flag (FCCF) indicates when a command is complete. The command sequence must be
completed by clearing FCBEF to launch the command.
is a flowchart for executing all
of the commands except for burst programming. The FCDIV register must be initialized before
using any flash commands. This must be done only once following a reset.
4. Wait until the FCCF bit in FSTAT is set. As soon as FCCF= 1, the operation has completed
successfully.
Содержание MC9S08LG16
Страница 2: ......
Страница 4: ......
Страница 8: ......
Страница 20: ......
Страница 26: ...Chapter 1 Device Overview MC9S08LG32 MCU Series Rev 5 26 Freescale Semiconductor...
Страница 40: ...Chapter 2 Pins and Connections MC9S08LG32 MCU Series Rev 5 40 Freescale Semiconductor...
Страница 96: ...Chapter 5 Resets Interrupts and General System Control MC9S08LG32 MCU Series Rev 5 96 Freescale Semiconductor...
Страница 296: ...Chapter 12 Serial Peripheral Interface S08SPIV4 MC9S08LG32 MCU Series Rev 5 296 Freescale Semiconductor...
Страница 372: ......