AN2183 Freescale Semiconductor / Motorola, AN2183 Datasheet - Page 26

no-image

AN2183

Manufacturer Part Number
AN2183
Description
Using FLASH as EEPROM on the MC68HC908GP32
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Application Note
EEFindFirst2:
EEFindFirst3:
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
EEWrite:
;
;
;
;
;
;
;
26
FlashEE Block Program Subroutine
This subroutine will write the block of data being pointed to by H:X into the FlashEE.
80 bytes of stack space is used, including this subroutine call return address.
FlashEE data block size is passed forward in ACC.
Calling convention:
Returns:
Changes:
Check for room within first FlashEE row.
Check for room within second FlashEE row (which is within the same erase page).
pula
ais
rts
ldhx
pshx
pshh
ldhx
lda
jsr
ais
psha
pshx
pshh
ldx
lda
psha
pulh
lda
bsr
cmp
bpl
ldx
lda
psha
pulh
aix
lda
bsr
cmp
bpl
#1
#EE_StartAddr
#BlockSourceAddress
#EE_BlockSize
WriteEE
#2
nothing
everything
7,sp
6,sp
3,sp
EEFindFirst
3,sp
EEWrite1
7,sp
6,sp
#EE_FlashRow
3,sp
EEFindFirst
3,sp
EEWrite1
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
=======================================================
; retrieve remaining erased bytes count
; deallocate stack usage
; return
; save FlashEE data block size
; save block
;
; get first FlashEE row address lsb
; get first FlashEE
;
;
; get FlashEE data block size
; go find next free location
; check if there’s room for another data block
; continue if so
; get first FlashEE row address lsb
; get first FlashEE
;
;
; H:X now points to second program row
; get FlashEE data block size
; go find next free location
; check if there’s room for another data block
; continue if so
source pointer
row address
row address
msb
msb
MOTOROLA
The
AN2183

Related parts for AN2183