AN2183 Freescale Semiconductor / Motorola, AN2183 Datasheet - Page 33

no-image

AN2183

Manufacturer Part Number
AN2183
Description
Using FLASH as EEPROM on the MC68HC908GP32
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Check_Read1:
Check_Read2:
;
Check_Read3:
Check_Read4:
;
;
;
;
Check_Erase:
;
Check_Erase1:
Check_Erase2:
;
Check_Erase3:
;
;
;
;
AN2183
MOTOROLA
Check for Erase command and execute.
Check for Write command and execute.
ldhx
lda
bra
ldhx
lda
psha
jsr
cmp
bne
pula
ldhx
jsr
bra
lda
jsr
lda
jsr
aix
dbnz
pula
bra
cmp
bne
jsr
jsr
cmp
beq
cmp
beq
jmp
ldhx
bra
ldhx
jsr
ldhx
jsr
bra
#EE_StartAddr1
#EE_BlockSize1
Check_Read3
#EE_StartAddr2
#EE_BlockSize2
EERead
#EE_FlashErased
Check_Read4
#msg_erased
PrintString
main
#’ ’
PutChar
,x
PutHexByte
#1
1,sp,Check_Read4
main
#cmd_erase
Check_Write
GetChar
PutChar
#’1’
Check_Erase1
#’2’
Check_Erase2
Check_What
#EE_StartAddr1
Check_Erase3
#EE_StartAddr2
EEErase
#msg_erased
PrintString
main
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
===================================================
===================================================
; point to start of 1st FlashEE
; get 1st FlashEE data block size
; continue
; point to start of 2nd FlashEE
; get 2nd FlashEE data block size
; save FlashEE data block size on stack
; move pointer to FlashEE data
; check if data is erased
; skip if not
; else, deallocate stack usage
; point to FlashEE erased message
; output it
; loop back to top
; output
;
; read FlashEE data
; output it
; advance FlashEE pointer
; loop back until done
; deallocate stack usage
; loop back to top
; check for Erase command
; skip if not
; get a character from the SCI
; echo character back
; check if target is 1st FlashEE
; continue if so
; check if target is 2nd FlashEE
; continue if so
; else, respond to unknown command
; point to start of 1st FlashEE
; continue
; point to start of 2nd FlashEE
; Erase FlashEE
; point to FlashEE erased message
; output it
; loop back to top
a space
Application Note
eetest.asm
33

Related parts for AN2183