
CHAPTER 6 16-BIT TIMER
User’s Manual U15075EJ1V0UM00
123
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 preset in 16-bit compare
register 90 (CR90) based on the intervals of the value set in TCL901 and TCL900.
To operate the 16-bit timer as a timer interrupt, the following settings are required.
Set count values in CR90
Set 16-bit timer mode control register 90 (TMC90) as shown in Figure 6-5.
Figure 6-5. Settings of 16-Bit Timer Mode Control Register 90 for Timer Interrupt Operation
0/1
0
0/1
TOD90 TOF90 CPT901 CPT900 TOC90 TCL901 TCL900 TOE90
TMC90
Setting of count clock (see Table 6-2)
Caution
If both the CPT901 and CPT900 flags are set to 0, the capture operation is prohibited.
When the count value of 16-bit timer counter 90 (TM90) matches the value set in CR90, counting of TM90
continues and an interrupt request signal (INTTM90) is generated.
Table 6-2 shows interval time, and Figure 6-6 shows timing of timer interrupt operation.
Caution
When rewriting the value in CR90 during a count operation, be sure to execute the following
processing.
<1> Set interrupt disabled (set TMMK90 (bit 4 of interrupt mask flag register 1 (MK1)) to 1).
<2> Disable inversion control of timer output data (set TOC90 to 0)
If the value in CR90 is rewritten in the interrupt-enabled state, an interrupt request may occur at
the moment of rewrite.
Table 6-2. Interval Time of 16-Bit Timer
TCL901
TCL900
Count Clock
Interval Time
00
2
2/fX (0.8
s)
2
18/fX (52.4 ms)
01
2
6/fX (12.8
s)
2
22/fX (838.9 ms)
10
2
7/fX (25.6
s)
2
23/fX (1.68 s)
11
1/fXT (30.5
s)
2
16/fXT (2.0 s)
Remarks 1. fX:
Main system clock oscillation frequency
2. fXT:
Subsystem clock oscillation frequency
3. The parenthesized values apply to operation at fX = 5.0 MHz or fXT = 32.768 kHz.