265
CHAPTER 14 16-BIT RELOAD TIMER
AND CCR,#0BFH ;Interrupts disabled
MOV I:ICR04,#00H ;Interrupt level 0 (highest)
MOV I:DDR8,00H ;Sets P82/TIN2 pin to input
CLRB I:CNTE0 ;Counter suspended
MOVW I:TMRLR2,#2710H;Reload value set to 10000 times
MOVW I:TMCSR2,#0000110001001011B
;Counter operation, rising edge,
;and external output disabled
;One-shot mode selected, interrupt enabled
;Interrupt flag cleared, count started
MOV ILM,#07H ;Set ILM in PS to level 7
OR CCR,#40H ;Interrupts enabled
LOOP:
:
Processing by user
:
BRA LOOP ;
;---------Interrupt program-----------------------------------
WARI:
CLR I:UF2 ;Interrupt request flag cleared
:
:
Processing by user
:
:
RETI ;Return from interrupt
CODE ENDS
;---------Vector setting----------------------------------------
VECT CSEG ABS=0FFH
ORG 00FFB0H ;Set vector to interrupt #19 (13
H
)
DSL WARI
ORG 00FFDCH ;Reset vector set
DSL START
DB 00H ;Set to single-chip mode
VECT ENDS
END START