R01UH0823EJ0100 Rev.1.00
Page 520 of 1823
Jul 31, 2019
RX23W Group
23. Multi-Function Timer Pulse Unit 2 (MTU2a)
(b) Free-Running Count Operation and Periodic Count Operation
Immediately after a reset, the MTU’s TCNT counters are all designated as free-running counters. When the relevant
CSTn bit in the TSTR register is set to 1, the corresponding TCNT counter starts up-count operation as a free-running
counter. When TCNT overflows (from FFFFh to 0000h), the MTU requests an interrupt if the corresponding TCIEV bit
in the TIER register is 1. After an overflow, the TCNT counter starts counting up again from 0000h.
illustrates free-running counter operation.
Figure 23.5
Free-Running Counter Operation
When compare match is selected as the TCNT clearing source, the TCNT counter for the relevant channel performs
periodic count operation. The TGR register for setting the cycle is designated as an output compare register, and counter
clearing by compare match is selected by means of the TCR.CCLR[2:0] bits. After the settings have been made, the
TCNT counter starts up-count operation as a periodic counter when the corresponding bit in the TSTR register is set to 1.
When the count matches the value in the TGR register, the TCNT counter is set to 0000h.
If the value of the corresponding TIER.TGIE bit is 1 at this point, the MTU requests an interrupt. After a compare match,
the TCNT counter starts counting up again from 0000h.
illustrates periodic counter operation.
Figure 23.6
Periodic Counter Operation
TCNT value
FFFFh
0000h
TSTR.CSTn
bit
Time
TCIV
Counter cleared by TGR compare match
Time
TCNT value
TGR
0000h
TSTR.CSTn
bit
TGI