English
Language : 

MC908AP8CFBE Datasheet, PDF (132/324 Pages) Freescale Semiconductor, Inc – Microcontrollers
Monitor ROM (MON)
8.5.6 EE_WRITE
EE_WRITE is used to write a set of data from the data array to FLASH.
Table 8-16. EE_WRITE Routine
Routine Name EE_WRITE
Routine Description
Emulated EEPROM write. Data size ranges from 7 to 15 bytes at
a time.
Calling Address $FF36
Stack Used 30 bytes
Data Block Format
Bus speed (BUS_SPD)
Data size (DATASIZE)(1)
Starting address (ADDRH)(2)
Starting address (ADDRL)(1)
Data 1
:
Data N
1. The minimum data size is 7 bytes. The maximum data size is 15 bytes.
2. The start address must be a page boundary start address.
The start location of the FLASH to be programmed is specified by the address ADDRH:ADDRL and the
number of bytes in the data array is specified by DATASIZE. The minimum number of bytes that can be
programmed in one routine call is 7 bytes, the maximum is 15 bytes. ADDRH:ADDRL must always be the
start of boundary address (the page start address: $X000, $X200, $X400, $X600, $X800, $XA00, $XC00,
or $XE00) and DATASIZE must be the same size when accessing the same page.
In some applications, the user may want to repeatedly store and read a set of data from an area of
non-volatile memory. This is easily possible when using an EEPROM array. As the write and erase
operations can be executed on a byte basis. For FLASH memory, the minimum erase size is the page —
512 bytes per page for MC68HC908AP64. If the data array size is less than the page size, writing and
erasing to the same page cannot fully utilize the page. Unused locations in the page will be wasted. The
EE_WRITE routine is designed to emulate the properties similar to the EEPROM. Allowing a more
efficient use of the FLASH page for data storage.
When the user dedicates a page of FLASH for data storage, and the size of the data array defined, each
call of the EE_WRTIE routine will automatically transfer the data in the data array (in RAM) to the next
blank block of locations in the FLASH page. Once a page is filled up, the EE_WRITE routine automatically
erases the page, and starts reuse the page again. In the 512-byte page, an 9-byte control block is used
by the routine to monitor the utilization of the page. In effect, only 503 bytes are used for data storage.
(see Figure 8-10). The page control operations are transparent to the user.
When using this routine to store a 8-byte data array, the FLASH page can be programmed 62 times
before the an erase is required. In effect, the write/erase endurance is increased by 62 times. When a
15-byte data array is used, the write/erase endurance is increased by 33 times. Due to the FLASH page
size limitation, the data array is limited from 7 bytes to 15 bytes.
MC68HC908AP Family Data Sheet, Rev. 4
132
Freescale Semiconductor