9.7
Program Example of Timebase Timer
Programming examples for the timebase timer are shown below.
Program Example of Timebase Timer
Processing specification
Interval interruptions of 2
time is about 0.68 ms (at 6-MHz operation).
Coding example
ICR14
TBTC
TBOF
;----------Main Program----------------------------------------------------
CODE
START:
;
LOOP:
;----------Interrupt Program----------------------------------------------------
WARI:
;
;
;
CODE
;----------Vector Settings----------------------------------------------------------
VECT
12
/HCLK (oscillation clock) are repeatedly generated. In this case, the interval
EQU
0000BEH
EQU
0000A9H
EQU
TBTC:3
CSEG
:
AND
CCR, #0BFH
MOV
I:ICR14, #00H
MOV
I:TBTC, #10010000B
MOV
ILM, #07H
OR
CCR, #40H
MOV
A,#00H
MOV
A,#01H
BRA
LOOP
CLR bit BOF
:
User processing
:
RETI
ENDS
CSEG
ABS=0FFH
CHAPTER 9 TIMEBASE TIMER
; Interrupt control register for timebase timer
; Timebase timer control register
; Interrupt request flag bit
; Initialize such as a stack pointer (SP)
; Disables the interrupt
; Interrupt level 0 (highest)
; Upper 3 bits fixed
; Interrupt enabled, TBOF Clear
; Counter Clear
; Interval Time Selection 2
; Sets ILM in PS to level 7
; Interruption permission
; infinite loop
; The interrupt request flag is clear
; Returns from interrupt
12
/HCLK selection
217