R01UH0822EJ0100 Rev.1.00
Page 426 of 1041
Jul 31, 2019
RX13T Group
19. Multi-Function Timer Pulse Unit 3 (MTU3c)
(1) Example of Complementary PWM Mode Setting Procedure
shows an example of the complementary PWM mode setting procedure.
Figure 19.45
Example of Complementary PWM Mode Setting Procedure
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[11]
[10]
[12]
[13]
<Complementary PWM mode>
Start count operation
Set MPC.
Enable waveform output
Complementary PWM mode
setting
Enable PWM cyclic output,
set PWM output level
Dead time, carrier period
setting
Enable/disable dead time
generation
TGR setting
Inter-channel synchronization
setting
TCNT setting
Brushless DC motor control
setting
Count clock, counter clear
source selection
Stop count operation
Complementary PWM mode
[1] Set the TSTRA.CST3 and TSTRA.CST4 bits to 0 to stop the TCNT count operation.
Specify complementary PWM mode while MTU3.TCNT and MTU4.TCNT are stopped.
[2] Set the TCR.TPSC[2:0] and TCR.CKEG[1:0] bits of MTU3 and MTU4 to select the same
count clock source and clock edge for MTU3 and MTU4.
Set the TCR.CCLR[2:0] bits only when restarting by synchronous clearing with another
channel during complementary PWM operation.
[3] To control a brushless DC motor, set the TGCRA.BDC bit and set the feedback signal
input source and output chopping or gate signal direct output (only when MTU3 and
MTU4 are used).
[4] Set the dead time in MTU3.TCNT. Set MTU4.TCNT to 0000h.
[5] Make this setting only when restarting by synchronous clearing with another channel
during complementary PWM mode operation. In this case, set the TSYRA register to
synchronize the channel generating the synchronous clear with MTU3 and MTU4.
[6] When MTU3 is used, set the PWM output duty ratio in the duty registers (MTU3.TGRB,
MTU4.TGRA, and MTU4.TGRB) and buffer registers (MTU3.TGRD, MTU4.TGRC, and
MTU4.TGRD).
Be sure to set the same value in each pair of the duty registers (MTU3.TGRD,
MTU4.TGRC, and MTU4.TGRD) and buffer registers (MTU3.TGRB, MTU4.TGRA, and
MTU4.TGRB).
Only when the double buffer function is used, set the buffer registers (MTU3.TGRE,
MTU4.TGRE, and MTU4.TGRF).
[7] This setting is necessary only when no dead time should be generated. Make
appropriate settings in the TDERA register so that no dead time generated.
[8] Set the dead time in the TDDRA register, 1/2 the PWM period in the TCDRA register and
TCBRA register, and 1/2 the PWM period plus the dead time in MTU3.TGRA and
MTU3.TGRC.
When no dead time generation is selected, set 1 in the TDDRA register and
1/2 the PWM 1 in MTU3.TGRA and MTU3.TGRC.
[9] Set the PSYE bit in the TOCR1A register to enable or disable toggle output synchronized
with the PWM period, and set the OLSP and OLSN bits to select the PWM output level.
When specifying the PWM output level using the TOCR2A and TOLBRA in buffer
operation, refer to Timer Output Level Buffer Registers (TOLBRA).
[10] Select complementary PWM mode in MTU3.TMDR1. Specify the buffer operation (BFA
= 1) of MTU3.TGRA and the buffer operation (BFB = 1) of MTU3.TGRB.
Only when the double buffer function is used, set the TMDR2A register to enable the
double buffer function.
[11] Set the TOERA register to enable or disable output from the PWM output pin. Then, set
the MTU3.TIORH, MTU3.TIORL, MTU4.TIORH, and MTU4.TIORL to 00h.
[12] Set the MPU and the port mode register (PMR) of the I/O ports.
[13] Set the TSTRA.CST3 and TSTRA.CST4 bits to 1 simultaneously to start count
operation.