R01UH0823EJ0100 Rev.1.00
Page 626 of 1823
Jul 31, 2019
RX23W Group
23. Multi-Function Timer Pulse Unit 2 (MTU2a)
(17) Operation When Error Occurs in Phase Counting Mode and Operation is Restarted in Normal
Mode
shows a case in which an error occurs in phase counting mode and operation is restarted in normal mode
after re-setting.
Figure 23.132
Error Occurrence in Phase Counting Mode, Recovery in Normal Mode
(1) After a reset, the MTU output goes low and the ports enter high-impedance state.
(2) Set phase counting mode.
(3) 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.)
(4) Use the MPC and the port mode register (PMR) for the I/O port to set up MTU output.
(5) Start count operation by setting the TSTR register.
(6) Output goes low on compare match occurrence.
(7) An error occurs.
(8) Use the port direction register (PDR) and port mode register (PMR) for the input port pin to switch it to operate as a
(9) Stop count operation by setting the TSTR register.
(10) Set normal mode.
(11) Initialize the pins with the TIOR register.
(12) Use the MPC and the port mode register (PMR) for the I/O port to set up MTU output.
(13) Restart operation by setting the TSTR register.
(1)
Reset
MTU module output
(2)
TMDR
(PCM)
(3)
TIOR
(1 init
0 out)
(5)
TSTR
(1)
(6)
Match
(7)
Error
occurs
(8)
Port
output
(9)
TSTR
(0)
(10)
TMDR
(normal)
(11)
TIOR
(1 init
0 out)
(13)
TSTR
(1)
MTIOCnA
MTIOCnB
PORT output
Pxx
Pxx
(4)
MPC
(MTU)
(12)
MPC
(MTU)
Hi-Z
Hi-Z