R01UH0823EJ0100 Rev.1.00
Page 552 of 1823
Jul 31, 2019
RX23W Group
23. Multi-Function Timer Pulse Unit 2 (MTU2a)
(2) Outline of Complementary PWM Mode Operation
In complementary PWM mode, six phases (three positive and three negative) of PWM waveforms can be output.
illustrates counter operation in complementary PWM mode, and
shows an example of operation in
complementary PWM mode.
(a) Counter Operation
In complementary PWM mode, three counters —MTU3.TCNT, MTU4.TCNT, and TCNTS— perform up-/down-count
operations.
The MTU3.TCNT counter is automatically initialized to the value set in the TDDR register when complementary PWM
mode is selected and the TSTR.CST3 bit is 0.
When the CST3 bit is set to 1, the MTU3.TCNT counter counts up to the value set in the MTU3.TGRA register, then
switches to down-counting when it matches the MTU3.TGRA register. When the MTU3.TCNT value matches the
TDDR register, the counter switches to up-counting, and the operation is repeated in this way.
The MTU4.TCNT counter should be initialized to 0000h.
When the CST4 bit is set to 1, the MTU4.TCNT counter counts up in synchronization with the MTU3.TCNT counter,
and switches to down-counting when it matches the TCDR register. On reaching 0000h, the MTU4.TCNT counter
switches to up-counting, and the operation is repeated in this way.
The TCNTS counter is a read-only counter. It does not need to be initialized.
When the MTU3.TCNT counter matches the TCDR register during up-/down-counting of the TCNT counter in MTU3
and MTU4, the TCNTS counter starts down-counting, and when the TCNTS counter matches the TCDR register, the
operation switches to up-counting. When the TCNTS counter matches the MTU3.TGRA register, it becomes 0000h.
When the MTU4.TCNT counter matches the TDDR register during down-counting of counters MTU3.TCNT and
MTU4.TCNT, the TCNTS counter starts up-counting, and when the TCNTS counter matches the TDDR register, the
operation switches to down-counting. When the TCNTS counter reaches 0000h, it is set with the value in the
MTU3.TGRA register.
The TCNTS counter is compared with the compare register and temporary register, in which the PWM duty is specified,
only during the count operation.
Figure 23.39
Counter Operation in Complementary PWM Mode
MTU4.TCNT
TCNTS
MTU3.TCNT
Time
Counter value
MTU3.TGRA
TCDR
TDDR
0000h
MTU3.TCNT
MTU4.TCNT
TCNTS