AN2690 Freescale Semiconductor / Motorola, AN2690 Datasheet - Page 28

no-image

AN2690

Manufacturer Part Number
AN2690
Description
Low Frequency EEPROM Emulation on the MC68HLC908QY4
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2690
;*******************************************************************************************
;* Name:
;* Description:
;*
;*
;* Calling Convention:
;* Inputs:
;* Outputs:
;* Routines used:
;* Stack usage:
;*******************************************************************************************
SwitchToXtal:
stxL1:
stxL2:
;*******************************************************************************************
;* Name:
;* Description:
;*
;*
;*
;* Calling Convention:
;* Inputs:
;* Outputs:
;* Routines used:
;* Stack usage:
;*******************************************************************************************
ProgEE:
28
dbnza
rts
bset
nop
nop
lda
clrx
dbnzx
bset
brclr
bclr
bset
rts
ldhx
lda
psha
jsr
lda
inca
sta
stxL1
PTA4, PORTA
#$A2
stxL1
ECGON, OSCSTAT
ECGST, OSCSTAT, stxL2
PTA1, PORTA
DDRA1, DDRA
#EeStart
#3
RdBlock
2,x
RamBfrStrt+2
Low Frequency EEPROM Emulation on the MC68HLC908QY4
SwitchToXtal
Switches the osc source from the internal Oscillator to the external
32768Hz oscillator.
bsr SwitchToXtal
none
none
none
none
ProgEE
This routine reads the last data written into EEPROM, increments the
count value and reprograms the EEPROM with the current led status
the ApplicationFlags and the updated count value.
bsr ProgEE
none
none
RdBlock, WrtBlock
1 byte
Freescale Semiconductor, Inc.
; return
For More Information On This Product,
;Outer loop = 3 x 162 (A2h) + 162 x 768 cycles = 124902 cycles
Go to: www.freescale.com
; Precharge external crystal circuit
;Wait 4096 cycles of 32KHz crystal.
;= 125ms = 125000cycles of 1meg bus
;Inner loop = 256 x 3 cycles = 768 cycles
; External clock generator enabled
; Wait for external clock source to be engaged
; clear external osc engaged flag
; PortA, bit1 is an output
;return
;Get start address of EEprom Block
;number of bytes in EEPROM
;save buffer size on stack
;gets pointer to latest data block
;get count value
;inc count
;store in buffer
MOTOROLA

Related parts for AN2690