
CHAPTER 6 16-BIT TIMER
User's Manual U11919EJ3V0UM00
99
6.4 16-Bit Timer Operation
6.4.1 Operation as timer interrupt
In the timer interrupt function, interrupts are repeatedly generated at the count value set to 16-bit compare
register 20 (CR20) in advance based on the intervals of the value set in TCL201 and TCL200.
To operate the 16-bit timer as a timer interrupt, the following settings are required.
Set count values in CR20
Set 16-bit timer mode control register 20 (TMC20) as shown in Figure 6-4.
Figure 6-4. Settings of 16-Bit Timer Mode Control Register 20 at Timer Interrupt Operation
-
0/1
0/1
0/1
0/1
0
0/1
0/1
TOD20 TOF20 CPT201 CPT200 TOC20 TCL201 TCL200 TOE20
TMC20
Setting of Count Clock (see
Table 6-2
)
Caution
If 0 is set both to CPT201 and CPT200 flags, capture edge becomes setting prohibited.
When the count value of 16-bit timer counter 20 (TM20) coincides with the value set to CR20, counting of TM20
continues and an interrupt request signal (INTTM2) is generated.
Table 6-2 shows interval time, and Figure 6-5 shows timing of timer interrupt operation.
Caution
Perform the following processing when rewriting CR20 during count operation.
<1> Disable the interrupt (TMMK20 (bit 7 of interrupt mask flag register 0 (MK0)) = 1).
<2> Disable inversion control of timer output data (TOC20 = 0).
If CR20 is rewritten with the interrupt enabled, an interrupt request may be issued
immediately.
Table 6-2. Interval Time of 16-Bit Timer 20
TCL201
TCL200
Count Clock
Interval Time
0
0
2
2
/f
X
(0.8
μ
s)
2
18
/f
X
(52.4 ms)
0
1
2
6
/f
X
(12.8
μ
s)
2
22
/f
X
(838.9 ms)
Other than above
Setting prohibited
Remarks 1.
f
X
: System clock oscillation frequency
2.
The parenthesized values apply to operation at f
X
= 5.0 MHz.