Renesas RX100 Series User Manual page 421

32-bit mcu
Hide thumbs Also See for RX100 Series:
Table of Contents

Advertisement

RX13T Group
(1) Example of Procedure for Setting Reset-Synchronized PWM Mode
Figure 19.42 shows an example of procedure for setting the reset-synchronized PWM mode.
Reset-synchronized
PWM mode
Stop counting
Select count clock and
counter clear source
Brushless DC motor
control setting
Set TCNT
Set TGR
Enable PWM cyclic output,
set PWM output level
Set reset-synchronized
PWM mode
Enable waveform output
Set MPC
Start count operation
<Reset-synchronized PWM mode>
Figure 19.42
Procedure for Selecting Reset-Synchronized PWM Mode
R01UH0822EJ0100 Rev.1.00
Jul 31, 2019
[1] Set the TSTRA.CST3 and TSTRA.CST4 bits to 0 to stop the TCNT
count operation.
Specify the reset-synchronized PWM mode while MTU3.TCNT
and MTU4.TCNT are stopped.
[1]
[2] Set the TCR.TPSC[2:0] and TCR.CKEG[1:0] bits of MTU3 to
select the count clock source and clock edge for MTU3.
Set the TCR.CCLR[2:0] bits to select TGRA compare match as the
[2]
counter clear source.
[3] To control a brushless DC motor, set the TGCRA.BDC bit and set
the feedback signal input source and output chopping or gate
[3]
signal direct output (only when MTU3 and MTU4 are used).
[4] Set MTU3.TCNT and MTU4.TCNT to 0000h.
[4]
[5] MTU3.TGRA is the period register. Set the PWM period in
MTU3.TGRA.
Set the PWM output transition timing in MTU3.TGRB,
[5]
MTU4.TGRA, and MTU4.TGRB.
Note that the setting values should be within the range of compare
match with MTU3.TCNT.
[6]
X  MTU3.TGRA (X: Set value)
[6] Set the PSYE bit in the TOCR1A register to enable or disable
[7]
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
[8]
Registers (TOLBRA).
[9]
[7] Set the MD[3:0] bits in MTU3.TMDR1 register to 1000b to select
the reset-synchronized PWM mode. Specify the buffer operation
(BFA = 1) of the MTU3.TGRA register and the buffer operation
[10]
(BFB = 1) of the MTU3.TGRB register when necessary. Set the
MTU4.TMDR1 register to the initial value (normal operation; BFA
= 0 and BFB = 0).
[8] 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 registers to 00h.
[9] Set the MPU and the port mode register (PMR) of the I/O ports.
[10] Set the TSTRA.CST3 bit to 1 to start count operation.
Note:
The output waveform starts to toggle at the point of
MTU3.TCNT = MTU3.TGRA = X by setting X = MTU3.TGRA,
i.e., period = duty ratio.
19. Multi-Function Timer Pulse Unit 3 (MTU3c)
Page 421 of 1041

Advertisement

Table of Contents
loading

Table of Contents