RX610 Group
16. Programmable Pulse Generator (PPG)
R01UH0032EJ0120 Rev.1.20
Page 551 of 1006
Feb 20, 2013
16.3.3
Example of Normal Pulse Output (Example of Five-Phase Pulse Output)
Figure 16.8 shows an example in which pulse output from the PPG0 is used for cyclic five-phase pulse output.
TCNT value
TCNT
TGRA
0000h
NDRH
PODRH
PO15
PO14
PO13
PO12
PO11
Time
Compare match
60
00
80
C0
40
20
30
10
18
08
88
C0
80
C0
80
40
30
10
18
08
88
80
C0
40
20
60
Figure 16.8 Example of Normal Pulse Output (Example of Five-Phase Pulse Output)
1. Set an output compare register of the TPU, i.e. TPUm.TGRA (m = 0 to 3) so that the corresponding compare match
signal is the output trigger. Set a cycle in TGRA so that the counter will be cleared by compare match A. Set the
TGIEA bit in TPUm.TIER to 1 to enable the compare match/input capture A (TGImA) interrupt.
2. Write F8h to PPG0.NDERH, and set the G3CMS[1:0] and G2CMS[1:0] bits in PPG0.PCR to select the respective
compare matches in the TPUm selected in the previous step to be the output triggers. Write output data 80h to
PPG0.NDRH.
3. The timer counter in the TPUm starts. When compare match A occurs, the values in PPG0.NDRH are transferred to
PPG0.PODRH and output. The TGImA interrupt handling routine writes the next output data C0h to PPG0.NDRH.
4. Five-phase pulse output (one or two phases active at a time) can be obtained subsequently by writing 40h, 60h, 20h,
30h, 10h, 18h, 08h, 88h... at successive TGImA interrupts.
If the DTC or DMAC is set for activation by the TGImA interrupt, pulse output can be obtained without imposing a
load on the CPU.
Summary of Contents for RX600 Series
Page 1006: ...RX610 Group R01UH0032EJ0120 ...