AN2690 Freescale Semiconductor / Motorola, AN2690 Datasheet - Page 29

no-image

AN2690

Manufacturer Part Number
AN2690
Description
Low Frequency EEPROM Emulation on the MC68HLC908QY4
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
;*******************************************************************************************
;* Name:
;* Description:
;*
;*
;* Calling Convention:
;* Inputs:
;* Outputs:
;* Routines used:
;* Stack usage:
;*******************************************************************************************
InitTimer:
;*******************************************************************************************
;* Name:
;* Description:
;*
;*
;*
;*
;* Calling Convention:
;* Inputs:
;* Outputs:
;* Routines used:
;* Stack usage:
;*******************************************************************************************
LedDriver:
Left:
MOTOROLA
mov
lda
and
sta
pula
ldhx
jsr
rts
mov
mov
mov
lda
bclr
mov
bclr
rts
lda
and
brset
brset
lsla
sta
bra
ApplicationFlags, RamBfrStrt+1 ;Store current application flags
PORTB
#%01111000
RamBfrStrt
#EeStart
WrtBlock
#$30,TSC
#$00,TMODH
#$50,TMODL
TSC
7,TSC
#$60,TSC
5,TSC
PORTB
#%01111000
DIRECTION_FLAG, ApplicationFlags, Right
PTB6, PORTB, Ptb6Set
PORTB
ledend
Low Frequency EEPROM Emulation on the MC68HLC908QY4
InitTimer
Sets up a timer overflow rate = 100Hz (10ms).For bus clock = 8KHz
Pre-Scale = 1, Modulo = 80 (50H)
bsr InitTimer
none
none
none
none
LedDriver
This routine controls the position of the illuminated LED.
reset the D8 (PTB3) is iluminated.
after each timeout (1000ms). When D5 (PTB6) is lit the sequence
is reversed and the bit is shifted back to the right.
bsr LedDriver
none
none
none
none
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
;get PortB
;only interested in Ptb6 - ptb3
;Copy port status variable into ram location
;get buffer size back
; return
; Stop timer, Reset Timer,
; Disable timer overflow interrupt
; set modulo to 80 (50H)
; Clear TOF flag - Read then write 0 to TOF
; Enable TOF Interrupt, Timer stopped, PS = 1 (000)
; Start timer
;return
;Only Interested in bits 6,5,4,3
; DIRECTION = 0 (LEFT)
This is shifted to the left
Appendix A: Sample Application
At
AN2690
29

Related parts for AN2690