RX610 Group
16. Programmable Pulse Generator (PPG)
R01UH0032EJ0120 Rev.1.20
Page 554 of 1006
Feb 20, 2013
16.3.5
Sample Setup Procedure for Non-Overlapping Pulse Output
Figures 16.11 and 16.12 show sample procedures for setting up non-overlapping pulse outputs.
(1)
PPG0 Setting
Select TGR functions
Set TGR values
Set counting operations
Select interrupt sources
Set initial output values
Enable pulse output
Select output triggers
Set next pulse
output values
Start counter
Set next pulse
output values
No
Yes
Compare match A?
Non-overlapping
pulse output
PPG0 setup
[1]
Set TIOR of the TPU (unit 0) to make TGRA and
TGRB output compare registers (output disabled).
[2]
Set the pulse output trigger period in TGRB
and the non-overlap period in TGRA.
[3]
Select the counter clock source with the
TPSC[2:0] bits in TCR. Select the counter clear
source with the CCLR[2:0] bits.
[4]
Enable the TGIA interrupt in TIER. The DTC or
DMAC can also be set up to transfer data to NDR.
[5]
Set the initial output values in PODR.
[6] Set the bits for the pins to be used for pulse output
to 1.
[7]
Select the TPU compare match event to be
used as the pulse output trigger in PCR.
[8]
In PMR, select the groups that will operate in
non-overlap mode.
[9]
Set the next pulse output values in NDR.
[10] Set the CST bit in TSTR to 1 to start the TCNT
counter.
[11] At each TGIA interrupt, set the next output
values in NDR.
Set non-overlapping groups
TPU (unit 0) setup
TPU (unit 0) setup
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10]
[11]
Figure 16.11 Sample Setup Procedure for Non-Overlapping Pulse Output (PPG0 Setting)