234CHAPTER 9 8-BIT TIMER/EVENT COUNTERS 1 AND 29.4.2 16-bit timer/event counter modeWhen bit 2 (TMC12) of the 8-bit timer mode control register (TMC1) is set to 1, the 16-bit timer/event counter modeis set.In this mode, the count clock is set with bits 0 to 3 (TCL10 to TCL13) of timer clock select register 1 (TCL1), andthe 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 timerThe 8-bit timer/event counter operates as an interval timer that generates interrupt requests repeatedly atintervals of the count value preset to 2-channel 8-bit compare registers (CR10 and CR20). When setting thecount value, set the value of the higher 8 bits to CR20 and the value of the lower 8 bits to CR10. For the countvalue 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 valuesmatch, 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), andthe overflow signal of TM1 becomes the count clock of TM2.Figure 9-11. Interval Timer Operation TimingRemark Interval time = (N + 1) × t : N = 0000H to FFFFHCaution Even if the 16-bit timer/event counter mode is used, when the TM1 count value matches theCR10 value, interrupt request (INTTM1) is generated and the F/F of 8-bit timer/event counteroutput control circuit 1 is inverted. Thus, when using 8-bit timer/event counter as 16-bitinterval 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 manipulationinstruction.Count ClockTMS (TM1, TM2) Count ValueCR10, CR20INTTM2TO2Interval Time Interval Time Interval TimeInterrupt Request Acknowledge Interrupt Request AcknowledgeN N N NCount Start Clear Clear0000 0001 N 0000 0001 N 0000 0001 Nt