Hardware Reference
In-Depth Information
brclr
CRGFLG,LOCK,*
; wait until PLL locks into the target frequency
rts
; ********************************************************************************
rtiISR
movb
#RTIF,CRGFLG
; clear the RTIF flag
ldx
base
; load the base address stored in base
ldab
dindex
; place the digit offset
movb
b,X,PTB
; output the segment pattern
cmpb
#0
beq
digit0
; turn on display #0
cmpb
#1
beq
digit1
; turn on display #1
cmpb
#2
beq
digit2
; turn on display #2
movb
#$07,PTP
; turn on display #3
bra
update
digit2
movb
#$0B,PTP
; turn on digit 2
bra
update
digit1
movb
#$0D,PTP
; turn on digit 1
bra
update
digit0
movb
#$0E,PTP
; turn on digit 0
update
inc
dindex
; switch to the next digit
ldaa
dindex
; check if we need to reset digit index to 0
cmpa
#4
; “
bne
nextc
movb
#0,dindex
nextc
ldy
timeCnt
; decrement repletion count
dey
; “
sty
timeCnt
; “
cpy
#0
; do we need to change to a new sequence?
bne
next
; the current four digits need not be changed yet
movw
#400,timeCnt
; restore the time count to 400
ldx
base
; shift to the next four digits (shift by 1)
inx
; “
stx
base
; “
cpx
#Seg7Pat 1 10
; is this the last sequence? (0,1,2,3)
bne
next
; “
movw
#Seg7Pat,base
; go back to the first sequence again
next rti
; ********************************************************************************
Seg7Pat dc.b $06, $5B, $4F, $66, $6D, $7D, $07, $7F, $6F, $3F, $06, $5B, $4F
; ********************************************************************************
org $FFF0
dc.w rtiISR
; RTI vector stored here
org $FFFE
dc.w start
; reset vector
end
Search WWH ::




Custom Search