English
Language : 

MC68HC908JW32_09 Datasheet, PDF (105/232 Pages) Freescale Semiconductor, Inc – M68HC08 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
64 ; Reserved data array
PRGRNGE
EQU
FLASH_START EQU
$FE10
$EE00
ORG
FLASH
INITIALISATION:
MOV #20, BUS_SPD
MOV #64, 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.
Table 7-12. ERARNGE Routine
Routine Name ERARNGE
Routine Description Erase a page or the entire array
Calling Address $FE13
Stack Used 10 bytes
Data Block Format
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 (512
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.
The ERARNGE routine do not use a data array. The DATASIZE byte is a dummy byte that is also not
used.
MC68HC908JW32 Data Sheet, Rev. 6
Freescale Semiconductor
105