R01UH0822EJ0100 Rev.1.00
Page 405 of 1041
Jul 31, 2019
RX13T Group
19. Multi-Function Timer Pulse Unit 3 (MTU3c)
(1) Example of PWM Mode Setting Procedure
shows an example of the PWM mode setting procedure.
Figure 19.25
Example of PWM Mode Setting Procedure
(2) Examples of PWM Mode Operation
shows an example of operation in PWM mode 1.
In this example, TGRA compare match is set as the TCNT clearing source, 0 is set as the initial output value and output
value for TGRA, and 1 is set as the output value for TGRB.
In this case, the value set in TGRA is used as the period, and the value set in TGRB is used as the duty ratio.
Figure 19.26
Example of PWM Mode 1 Operation (n = 0 to 4)
[1]
PWM mode
Enable waveform output
[2]
[3]
[4]
[5]
[6]
[7]
Select count clock
Select counter clearing
source
Set PWM mode
Select waveform output
level
Set TGR
Start count
<PWM mode>
[1] Enable TOERA output when outputting a waveform
from the MTIOC pin of MTU3 and MTU4.
[2] 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.
[3] Use bits CCLR[2:0] in TCR to select the TGR to be
used as the TCNT clearing source.
[4] Select the PWM mode with bits MD[3:0] in TMDR.
[5] Use TIOR to designate the TGR as an output
compare register, and select the initial value and
output value.
[6] Set the period in the TGR selected in [3], and set the
duty ratio in the other TGR.
[7] Set the CSTn bit in TSTRA to 1 to start the count
operation.
TCNT value
Time
Counter cleared by TGRA compare match
TGRA
0000h
MTIOCnA
TGRB