R01UH0823EJ0100 Rev.1.00
Page 618 of 1823
Jul 31, 2019
RX23W Group
23. Multi-Function Timer Pulse Unit 2 (MTU2a)
(7) Operation When Error Occurs in PWM Mode 1 and Operation is Restarted in Normal Mode
shows a case in which an error occurs in PWM mode 1 and operation is restarted in normal mode after
re-setting.
Figure 23.122
Error Occurrence in PWM Mode 1, Recovery in Normal Mode
(1) After a reset, the MTU output goes low and the ports enter high-impedance state.
(2) Set PWM mode 1.
(3) For MTU3 and MTU4, enable output with the TOER register before initializing the pins with the TIOR register.
(4) Initialize the pins with the TIOR register. (In the example, the initial output is a high level, and a low level is output
on compare match occurrence. In PWM mode 1, the MTIOCnB side is not initialized.)
(5) Use the MPC and the port mode register (PMR) for the I/O port to set up MTU output.
(6) Start count operation by setting the TSTR register.
(7) Output goes low on compare match occurrence.
(8) An error occurs.
(9) Use the port direction register (PDR) and port mode register (PMR) for the input port pin to switch it to operate as a
(10) Stop count operation by setting the TSTR register.
(11) Set normal mode.
(12) Initialize the pins with the TIOR register.
(13) Use the MPC and the port mode register (PMR) for the I/O port to set up MTU output.
(14) Restart operation by setting the TSTR register.
(1)
Reset
MTU module output
(2)
TMDR
(PWM1)
(3)
TOER
(1)
(4)
TIOR
(1 init
0 out)
(6)
TSTR
(1)
(7)
Match
(8)
Error
occurs
(9)
Port
output
(10)
TSTR
(0)
(11)
TMDR
(normal)
(12)
TIOR
(1 init
0 out)
(14)
TSTR
(1)
PORT output
Pxx
Pxx
MTIOCnA
MTIOCnB
(5)
MPC
(MTU)
(13)
MPC
(MTU)
Not initialized (MTIOCnB)
Hi-Z
Hi-Z