English
Language : 

MC908JL8CDWE Datasheet, PDF (97/212 Pages) Freescale Semiconductor, Inc – Microcontrollers
:
FILE_PTR:
BUS_SPD
DATASIZE
START_ADDR
DATAARRAY
ORG
DS.B
DS.B
DS.W
DS.B
RAM
1; Indicates 4x bus frequency
1; Data size to be programmed
1; FLASH start address
32; Reserved data array
PRGRNGE
EQU
FLASH_START EQU
$FC06
$EF00
ORG
FLASH
INITIALISATION:
MOV #20, BUS_SPD
MOV #32, DATASIZE
LDHX #FLASH_START
STHX START_ADDR
RTS
MAIN:
BSR INITIALISATION
:
:
LDHX #FILE_PTR
JSR PRGRNGE
7.5.2 ERARNGE
ERARNGE is used to erase a range of locations in FLASH.
Routine Name
Routine Description
Calling Address
Stack Used
Data Block Format
Table 7-12. ERARNGE Routine
ERARNGE
Erase a page or the entire array
$FCBE
9 bytes
Bus speed (BUS_SPD)
Data size (DATASIZE)
Starting address (ADDRH)
Starting address (ADDRL)
ROM-Resident Routines
There are two sizes of erase ranges: a page or the entire array. The ERARNGE will erase the page (64
consecutive bytes) in FLASH specified by the address ADDRH:ADDRL. This address can be any address
within the page. Calling ERARNGE with ADDRH:ADDRL equal to $FFFF will erase the entire FLASH
array (mass erase). Therefore, care must be taken when calling this routine to prevent an accidental mass
erase. To avoid undesirable routine return addresses after a mass erase, the ERARNGE routine should
not be called from code executed from FLASH memory. Load the code into an area of RAM before calling
the ERARNGE routine.
The ERARNGE routine do not use a data array. The DATASIZE byte is a dummy byte that is also not
used.
MC68HC908JL8/JK8 • MC68HC08JL8/JK8 • MC68HC908KL8 Data Sheet, Rev. 3.1
Freescale Semiconductor
97