R01UH0822EJ0100 Rev.1.00
Page 387 of 1041
Jul 31, 2019
RX13T Group
19. Multi-Function Timer Pulse Unit 3 (MTU3c)
19.3
Operation
19.3.1
Basic Functions
Each channel has TCNT and TGR register. TCNT performs up-counting, and is also capable of free-running operation,
periodic counting, and external event counting.
Each TGR register can be used as an input capture register or an output compare register.
(1) Counter Operation
When one of bits CST0 to CST4 in the TSTRA register, and bits CSTU5, CSTV5, and CSTW5 in the MTU5.TSTR
register is set to 1, TCNT for the corresponding channel begins counting. TCNT can operate as a free-running counter,
periodic counter, for example.
(a) Example of Count Operation Setting Procedure
shows an example of the count operation setting procedure.
Figure 19.4
Example of Count Operation Setting Procedure
<Periodic counter>
<Free-running counter>
Select count clock
Operation selection
Periodic counter
Set period
Select output compare
register
Select counter clearing
source
Start count operation
Free-running counter
Start count operation
[1]
[2]
[3]
[4]
[5]
[5]
[1] Select the count clock source with bits
TPSC[2:0] in TCR. At the same time,
select the clock edge with bits
CKEG[1:0] in TCR.
[2] For periodic counter operation, select
the TGR to be used as the TCNT
clearing source with bits CCLR[2:0] in
TCR.
[3] Designate the TGR selected in [2] as
an output compare register by means
of TIOR.
[4] Set the periodic counter period in the
TGR selected in [2].
[5] Set the CSTn bit in TSTRA or
MTU5.TSTR to 1 to start the counter
operation.