Sample Setup Procedure For Normal Pulse Output; Figure 11.4 Setup Procedure For Normal Pulse Output (Example) - Renesas H8S/2368 Series Hardware Manual

16-bit single-chip microcomputer
Table of Contents

Advertisement

11.4.2

Sample Setup Procedure for Normal Pulse Output

Figure 11.4 shows a sample procedure for setting up normal pulse output.
TPU setup
Port and
PPG setup
TPU setup

Figure 11.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
[1] Set TIOR to make TGRA an output
compare register (with output
disabled)
[1]
[2] Set the PPG output trigger period
[2]
[3] Select the counter clock source with
bits TPSC2 to TPSC0 in TCR.
[3]
Select the counter clear source with
bits CCLR2 to CCLR0.
[4]
[4] Enable the TGIA interrupt in TIER.
The DTC or DMAC can also be set
[5]
up to transfer data to NDR.
[6]
[5] Set the initial output values in
PODR.
[7]
[6] Set the DDR and NDER bits for the
pins to be used for pulse output to 1.
[8]
[7] Select the TPU compare match
event to be used as the output
[9]
trigger in PCR.
[8] Set the next pulse output values in
NDR.
[9] Set the CST bit in TSTR to 1 to start
the TCNT counter.
[10]
[10] At each TGIA interrupt, set the next
output values in NDR.
Rev. 2.00, 05/03, page 465 of 820

Advertisement

Table of Contents
loading

This manual is also suitable for:

H8s seriesH8s/2300 series

Table of Contents