
FLASH Memory
MC68HC908GP32 MC68HC08GP32 Data Sheet, Rev. 7
110
Freescale Semiconductor
11.6 FLASH Program Operation
Programming of the FLASH memory is done on a row basis. A row consists of 64 consecutive bytes
starting from addresses $XX00, $XX40, $0080 and $XXC0. Use this step-by-step procedure to program
a row of FLASH memory
(Figure 11-2 is a flowchart representation):
1.
Set the PGM bit. This configures the memory for program operation and enables the latching of
address and data for programming.
2.
Read from the FLASH block protect register.
3.
Write any data to any FLASH address within the row address range desired.
4.
Wait for a time, tnvs (min. 10s).
5.
Set the HVEN bit.
6.
Wait for a time, tpgs (min. 5s).
7.
Write data to the FLASH address to be programmed. (See note.)
8.
Wait for a time, tPROG (min. 30s).
9.
Repeat step 7 and 8 until all the bytes within the row are programmed.
10.
Clear the PGM bit. (See note.)
11.
Wait for a time, tnvh (min. 5s).
12.
Clear the HVEN bit.
13.
After time, trcv (min. 1s), the memory can be accessed in read mode again.
NOTE
The time between each FLASH address change (step 7 to step 7), or the
time between the last FLASH address programmed to clearing PGM bit
(step 7 to step 10), must not exceed the maximum programming time,
tPROG max.
This program sequence is repeated throughout the memory until all data is programmed.
NOTE
Programming and erasing of FLASH locations cannot be performed by
code being executed from the FLASH memory. While these operations
must be performed in the order shown, other unrelated operations may
occur between the steps. Do not exceed tPROG maximum. See 23.17 11.7 FLASH Block Protection
Due to the ability of the on-board charge pump to erase and program the FLASH memory in the target
application, provision is made for protecting a block of memory from unintentional erase or program
operations due to system malfunction. This protection is done by using of a FLASH Block Protect Register
(FLBPR). The FLBPR determines the range of the FLASH memory which is to be protected. The range
of the protected area starts from a location defined by FLBPR and ends at the bottom of the FLASH
memory ($FFFF). When the memory is protected, the HVEN bit cannot be set in either ERASE or
PROGRAM operations.
NOTE
In performing a program or erase operation, the FLASH block protect
register must be read after setting the PGM or ERASE bit and before
asserting the HVEN bit