English
Language : 

HT66F4360 Datasheet, PDF (38/263 Pages) Holtek Semiconductor Inc – Smart Card Reader Flash MCU
HT66F4360/HT66F4370/HT66F4390
Smart Card Reader Flash MCU
Flash Memory Erase/Write Flow
It is important to understand the Flash memory Erase/Write flow before the Flash memory contents
are updated. Users can refer to the corresponding operation procedures when developing their IAP
program to ensure that the flash memory contents are correctly updated.
• Flash Memory Erase/Write Flow Descriptions
1. Activate the “Flash Memory Erase/Write function enable procedure” first. When the Flash
Memory Erase/Write function is successfully enabled, the CFWEN bit in the FCR register will
automatically be set high by hardware. After this, Erase or Write operations can be executed on
the Flash memory. Refer to the “Flash Memory Erase/Write Function Enable Procedure” for
details.
2. Configure the flash memory address to select the desired erase page and then erase this page.
3. Execute a Blank Check operation to ensure whether the page erase operation is successful or not.
The “TABRD” instruction should be executed to read the flash memory contents and to check if
the contents is 0000h or not. If the flash memory page erase operation fails, users should go back
to Step 2 and execute the page erase operation again.
4. Write data into the specific page. Refer to the “Flash Memory Write Procedure” for details.
5. Execute the “TABRD” instruction to read the flash memory contents and check if the written
data is correct or not. If the data read from the flash memory is different from the written data,
it means that the page write operation has failed. The CLWB bit should be set high to clear the
write buffer and then write the data into the specific page again if the write operation has failed.
6. Clear the CFWEN bit to disable the Flash Memory Erase/Write function enable mode if the
current page Erase and Write operations are complete if no more pages need to be erased or
written.
Rev. 1.30
38
December 15, 2016