Chapter 4 Memory
MC9S08DV60 Series Data Sheet, Rev 2
Freescale Semiconductor
53
4.5.2
Program and Erase Times
Before any program or erase command can be accepted, the Flash clock divider register (FCDIV) must be
written to set the internal clock for the Flash module to a frequency (fFCLK) between 150 kHz and 200 kHz
so normally this write is performed during reset initialization. The user must ensure that FACCERR is not
set before writing to the FCDIV register. One period of the resulting clock (1/fFCLK) is used by the
command processor to time program and erase pulses. An integer number of these timing pulses is used
by the command processor to complete a program or erase command.
Table 4-6 shows program and erase times. The bus clock frequency and FCDIV determine the frequency
of FCLK (fFCLK). The time for one cycle of FCLK is tFCLK = 1/fFCLK. The times are shown as a number
of cycles of FCLK and as an absolute time for the case where tFCLK =5 μs. Program and erase times
shown include overhead for the command state machine and enabling and disabling of program and erase
voltages.
4.5.3
Program and Erase Command Execution
The FCDIV register must be initialized after any reset and any error ag 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 rst step in any command sequence. For
erase and blank check commands, the value of the data is not important. For sector erase
commands, the address can be any address in the sector of Flash to be erased. For mass erase and
blank check commands, the address can be any address in the Flash .
NOTE
Before programming a particular byte in the Flash , the sector in which that
particular byte resides must be erased by a mass or sector erase operation.
Reprogramming bits in an already programmed byte without rst
performing an erase operation may disturb data stored in the Flash memory.
2. Write the command code for the desired command to FCMD. The six valid commands are blank
check (0x05), byte program (0x20), burst program (0x25), sector erase (0x40), mass erase1 (0x41),
and sector erase abort (0x47). The command code is latched into the command buffer.
Table 4-6. Program and Erase Times
Parameter
Cycles of FCLK
Time if FCLK = 200 kHz
Byte program
9
45
μs
Burst program
4
20
μs1
1 Excluding start/end overhead
Sector erase
4000
20 ms
Mass erase
20,000
100 ms
Sector erase abort
4
20
μs1
1. A mass erase is possible only when the Flash block is fully unprotected.