5
9.
Operation of Interval Timer Function
This section describes the operation of the interval timer function of the 16-bit timer/
counter.
n Operation of Interval Timer Function
Figure 9.5a shows the settings required to operate the interval timer function.
On activation (TMCR: TCS = "1"), the counter starts counting-up from the TCR register value on
the rising edge of the internal count clock (1t
counter value overflows (FFFF
flag bit (TMCR: TCEF = "1"). The counter values are restarted counting-up from "0000
overflow.
Figure 9.5b shows the interval timer operation.
*1: Stop timer operation, modify the TCR value (0000
*2: The counter restarts counting from "0000
Check: Do not write to the TCR register while the interval timer function is operating (TMCR: TCS = "1").
190
CHAPTER 9 16-BIT TIMER/COUNTER
Bit 7
TMCR
—
TCHR
TCLR
Figure 9.5a Interval Timer Function Settings
Counter value
FFFF
H
0080
H
0000
H
Timer cycle
TCR value
TCR value modified
(0000
)
H
TCEF bit
TCS bit
Activate
Figure 9.5b Operation of Interval Timer
Bit 6
Bit 5
Bit 4
Bit 3
—
TCR
TCS1
TCS0
1
0
Sets the counter initial value (upper 8 bits).
Sets the counter initial value (lower 8 bits).
: divide-by-four source oscillation). When the
inst
→ 0000
), the 16-bit timer/counter sets the interrupt request
H
H
Counter cleared by
Timer cycle
the program
(TMCR: TCR = "0")
*1
Overflow
(0080
)
H
Cleared by the program
Stop Reactivate
→ 0080
H
" after an overflow.
H
Bit 2
Bit 1
Bit 0
TCEF
TCIE
TCS
0
*2
Stop
), then reactivate timer operation.
H
: Used bit
1 : Set "1".
0 : Set "0".
" after an
H
Time
MB89620 series