10.4.2
Sample Setup Procedure for Normal Pulse Output
Figure 10.4 shows a sample procedure for setting up normal pulse output.
TPU setup
PPG setup
TPU setup
Figure 10.4 Setup Procedure for Normal Pulse Output (Example)
Normal PPG output
Select TGR functions
Set TGRA value
Set counting operation
Select interrupt request
Set initial output data
Enable pulse output
Select output trigger
Set next pulse
output data
Start counter
No
Compare match?
Yes
Set next pulse
output data
Section 10 Programmable Pulse Generator (PPG)
[1]
Set TIOR to make TGRA an output
compare register (with output disabled).
[2]
Set the PPG output trigger cycle.
[1]
[3]
Select the counter clock source with bits
[2]
TPSC2 to TPSC0 in TCR. Select the
counter clear source with bits CCLR1 and
CCLR0.
[3]
[4]
Enable the TGIA interrupt in TIER. The
DMAC can also be set up to transfer data
[4]
to NDR.
[5]
[5]
Set the initial output values in PODR.
[6]
Set the bits in NDER for the pins to be
[6]
used for pulse output to 1.
[7]
Select the TPU compare match event to
[7]
be used as the output trigger in PCR.
[8]
Set the next pulse output values in NDR.
[8]
[9]
Set the CST bit in TSTR to 1 to start the
TCNT counter.
[9]
[10] At each TGIA interrupt, set the next
output values in NDR.
[10]
Rev. 3.00 Mar. 14, 2006 Page 357 of 804
REJ09B0104-0300