AN2690 Freescale Semiconductor / Motorola, AN2690 Datasheet - Page 30

no-image

AN2690

Manufacturer Part Number
AN2690
Description
Low Frequency EEPROM Emulation on the MC68HLC908QY4
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2690
Ptb6Set:
Right:
Ptb3Set:
ledend:
;*******************************************************************************************
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*******************************************************************************************
RdBlock:
skipdec:
30
bset
lsra
sta
bra
brset
lsra
sta
bra
bclr
lsla
sta
rts
RdBlock - Reads a block of data from FLASH and puts it in RAM
Calling convention:
Inputs:
Returns: H:X - pointing to start of FLASH block containing data
Uses:
psha
bsr
cmp
bne
txa
and
beq
txa
sub
tax
lda
ais
DIRECTION_FLAG, ApplicationFlags
PORTB
ledend
PTB3, PORTB, Ptb3Set
PORTB
ledend
DIRECTION_FLAG, ApplicationFlags
PORTB
FindClear
#$FF
skipdec
#$3F
skipdec
1,sp
,x
#1
H:X - pointing to start of FLASH page used for data
A
A
FindClear
- block size
- data from first byte of block
Low Frequency EEPROM Emulation on the MC68HLC908QY4
Freescale Semiconductor, Inc.
ldhx
lda
jsr
For More Information On This Product,
#Blk1page
#Blk1Size
RdBlock
Go to: www.freescale.com
; DIRECTION = 1 (RIGHT)
; DIRECTION = 0 (LEFT)
;save block size
;find first erased block
;was an erased block found ?
;if not then don't go back a block
;get LS byte of address
;only look at address within page
;if 0 then no data so don't go back
;if not get LS byte of address again
;and subtract block size to point
;to start of valid data block
;get first byte of data
;de-allocate stack
MOTOROLA

Related parts for AN2690