234
CHAPTER 9 8-BIT TIMER/EVENT COUNTERS 1 AND 2
9.4.2 16-bit timer/event counter mode
When bit 2 (TMC12) of the 8-bit timer mode control register (TMC1) is set to 1, the 16-bit timer/event counter mode
is set.
In this mode, the count clock is set with bits 0 to 3 (TCL10 to TCL13) of timer clock select register 1 (TCL1), and
the overflow signal of 8-bit timer register 1 (TM1) becomes the count clock of 8-bit timer register 2 (TM2).
In this mode, enable/disable of the count operation is selected with bit 0 (TCE1) of TMC1.
(1) Operation as interval timer
The 8-bit timer/event counter operates as an interval timer that generates interrupt requests repeatedly at
intervals of the count value preset to 2-channel 8-bit compare registers (CR10 and CR20). When setting the
count value, set the value of the higher 8 bits to CR20 and the value of the lower 8 bits to CR10. For the count
value that can be set, refer to Table 9-9.
When 8-bit timer register 1 (TM1) and CR10 values match and 8-bit timer register 2 (TM2) and CR20 values
match, counting continues with the TM1 and TM2 values cleared to 0 and the interrupt request signal (INTTM2)
is generated. For the timing of interval timer operation, refer to Figure 9-11.
The count clock is selected with bits 0 to 3 (TCL10 to TCL13) of timer clock select register 1 (TCL1), and
the overflow signal of TM1 becomes the count clock of TM2.
Figure 9-11. Interval Timer Operation Timing
Remark Interval time = (N + 1) × t : N = 0000H to FFFFH
Caution Even if the 16-bit timer/event counter mode is used, when the TM1 count value matches the
CR10 value, interrupt request (INTTM1) is generated and the F/F of 8-bit timer/event counter
output control circuit 1 is inverted. Thus, when using 8-bit timer/event counter as 16-bit
interval timer, set the INTTM1 mask flag TMMK1 to 1 to disable INTTM1 acknowledgment.
When reading the 16-bit timer register (TMS) count value, use the 16-bit memory manipulation
instruction.
Count Clock
TMS (TM1, TM2) Count Value
CR10, CR20
INTTM2
TO2
Interval Time Interval Time Interval Time
Interrupt Request Acknowledge Interrupt Request Acknowledge
NN NN
Count Start Clear Clear
0000 0001 N 0000 0001 N 0000 0001 N
t