AN2183 Freescale Semiconductor / Motorola, AN2183 Datasheet - Page 34

no-image

AN2183

Manufacturer Part Number
AN2183
Description
Using FLASH as EEPROM on the MC68HC908GP32
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Application Note
Check_Write:
;
Check_Write1:
Check_Write2:
Check_Write3:
;
Check_Write4:
;
;
;
;
Check_Dump:
;
34
Check for Dump command and execute.
cmp
bne
jsr
jsr
cmp
beq
cmp
beq
jmp
ldhx
lda
bra
ldhx
lda
pshx
pshh
psha
psha
lda
jsr
ldhx
jsr
bne
sta
lda
jsr
aix
dbnz
pula
pula
ldhx
jsr
ais
jmp
cmp
bne
jsr
jsr
cmp
beq
cmp
beq
jmp
#cmd_write
Check_Dump
GetChar
PutChar
#’1’
Check_Write1
#’2’
Check_Write2
Check_What
#EE_StartAddr1
#EE_BlockSize1
Check_Write3
#EE_StartAddr2
#EE_BlockSize2
#’=’
PutChar
#buffer
GetHexByte
Check_What
,x
#’ ’
PutChar
#1
1,sp,Check_Write4
#buffer
EEWrite
#2
main
#cmd_dump
Check_What
GetChar
PutChar
#’1’
Check_Dump1
#’2’
Check_Dump2
Check_What
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
; check for Write 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
; get 1st FlashEE data block size
; continue
; point to start of 2nd FlashEE
; get 2nd FlashEE data block size
; save FlashEE address lsb temporarily
; save FlashEE address msb temporarily
; save FlashEE data block size temporarily
; initialize a counter with value too
; output ’=’ to indicate
;
; reset buffer pointer
; go retrieve data byte
; output error if not hexadecimal
; save data in buffer
; output
;
; advance buffer pointer
; loop back until entire FlashEE block received
; deallocate stack usage
; retrieve FlashEE data block size
; point to buffer (FlashEE address is on stack)
; write data into FlashEE
; deallocte stack usage
; loop back to top
; check for Dump 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
ready for data
a space
MOTOROLA
AN2183

Related parts for AN2183