ROM-Resident Routines
F L A S H
PAGE BOUNDARY
CONTROL: 9 BYTES
DATA ARRAY
DATA ARRAY
DATA ARRAY
ONE PAGE = 512 BYTES
PAGE BOUNDARY
Figure 8-10. EE_WRITE FLASH Memory Usage
The coding example below uses the $EE00–$EFFF page for data storage. The data array size is 15
bytes, and the bus speed is 4.9152 MHz. The coding assumes the data block is already loaded in RAM,
with the address pointer, FILE_PTR, pointing to the first byte of the data block.
ORG
RAM
:
FILE_PTR:
BUS_SPD
DATASIZE
START_ADDR
DATAARRAY
DS.B
DS.B
DS.W
DS.B
1
1
1
15
; Indicates 4x bus frequency
; Data size to be programmed
; FLASH starting address
; Reserved data array
EE_WRITE
FLASH_START
EQU
EQU
$FF36
$EE00
ORG
FLASH
INITIALISATION:
MOV
MOV
#20,
#15,
BUS_SPD
DATASIZE
LDHX
STHX
RTS
#FLASH_START
START_ADDR
MAIN:
BSR
:
INITIALISATION
:
LHDX
JSR
#FILE_PTR
EE_WRITE
NOTE
The EE_WRITE routine is unable to check for incorrect data blocks, such
as the FLASH page boundary address and data size. It is the responsibility
of the user to ensure the starting address indicated in the data block is at
the FLASH page boundary and the data size is 7 to 15. If the FLASH page
is already programmed with a data array with a different size, the
EE_WRITE call will be ignored.
MC68HC908AP Family Data Sheet, Rev. 4
Freescale Semiconductor
133