CHAPTER 6 16-BIT TIMER
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
TOD90 TOF90 CPT901 CPT900 TOC90 TCL901 TCL900 TOE90
TMC90
−
0/1
0/1
0/1
0/1
0
0/1
0/1
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
0
0
1
1
0
1
0
1
22/fX (0.8 µs)
26/fX (12.8 µs)
27/fX (25.6 µs)
1/fXT (30.5 µs)
218/fX (52.4 ms)
222/fX (838.9 ms)
223/fX (1.68 s)
216/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.
User’s Manual U15075EJ1V0UM00
123