RX610 Group
15. 16-Bit Timer Pulse Unit (TPU)
R01UH0032EJ0120 Rev.1.20
Page 500 of 1006
Feb 20, 2013
(1)
Example of PWM Mode Setting Procedure
Figure 15.21 shows an example of the PWM mode setting procedure.
Select counter clock
PWM mode
Select counter clearing source
Select waveform output level
<PWM mode>
[1]
[2]
[3]
Set TGRm
Set PWM mode
Start counting
[4]
[5]
[6]
Select the counter clock with the
TPSC[2:0] bits in TCR. At the same time,
select the input clock edge with the
CKEG[1:0] bits in TCR.
[1]
Select the TGRy register to be used as
the TCNT clearing source with the
CCLR[2:0] bits in TCR (y = A to D).
[2]
Set TGRy as an output compare register
by TIOR, and select the initial value and
output value.
[3]
Set the cycle in TGRy selected in [2], and
set the duty in the other TGRy registers.
[4]
Select the PWM mode with the MD[3:0]
bits in TMDR.
[5]
Set the CSTj bit in TSTRy to 1 to start
count operation (y = A, B, j = 0 to 5).
[6]
Figure 15.21 Example of PWM Mode Setting Procedure