EXTENDED FUNCTION TIMER (EFT)
EXTENDED FUNCTION TIMER (Cont’d)
Note: A single access (read/write) to the SR regis-
ter at the beginning of the interrupt routine is the
first step needed to clear all the EFT interrupt
flags. In a second step, the lower bytes of the data
registers must be accessed if the corresponding
flag is set. It is not necessary to access the SR
register between these instructions, but it can
done.
; INTERRUPT ROUTINE EXAMPLE
push R234
spp #28
; Save current page
; Set EFT page
L6:
cp R254,#0
jxz L7
; while E0_SR is not cleared
tm R254,#128
jxz L2
; Check Input Capture 1 flag
; else go to next test
ld r1,R241
; Dummy read to clear IC1LR
; Insert your code here
L2:
L3:
tm R254,#16
jxz L3
; Check Input Capture 2 flag
; else go to next test
ld r1,R243
; Insert your code here
; Dummy read to clear IC2LR
tm R254,#64
jxz L4
; Check Input Compare 1 flag
; else go to next test
ld r1,R249
; Dummy read to clear OC1LR
; Insert your code here
L4:
L5:
tm R254,#8
jxz L5
; Check Input Compare 2 flag
; else go to next test
ld r1,R251
; Dummy read to clear OC1LR
; Insert your code here
tm R254,#32
jxz L6
; Check Input Overflow flag
; else go to next test
ld r1,R245
; Dummy read to clear Overflow flag
; Insert your code here
jx L6
L7:
pop R234
; Restore current page
iret
179/426
9