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

16-bit single-chip microcomputer
Hide thumbs Also See for H8S Series:
Table of Contents

Advertisement

12.4.3

Sample Setup Procedure for Normal Pulse Output

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

Figure 12.4 Setup Procedure for Normal Pulse Output (Example)

Normal PPG output
Select TGR functions
[1]
Set TGRA value
[2]
Set counting operation
[3]
Select interrupt request
[4]
Set initial output data
[5]
Enable pulse output
[6]
Select output trigger
[7]
Set next pulse
[8]
output data
Start counter
[9]
No
Compare match?
Yes
Set next pulse
[10]
output data
Section 12 Programmable Pulse Generator (PPG)
[1] Set TIOR to make TGRA an output
compare register (with output
disabled).
[2] Set the PPG output trigger period.
[3] Select the counter clock source with
bits TPSC2 to TPSC0 in TCR.
Select the counter clear source with
bits CCLR1 and CCLR0.
[4] Enable the TGIA interrupt in TIER.
The DTC can also be set up to
transfer data to NDR.
[5] Set the initial output values in
PODR.
[6] Set the DDR and NDER bits for the
pins to be used for pulse output to 1.
[7] Select the TPU compare match
event to be used as the output
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] At each TGIA interrupt, set the next
output values in NDR.
Rev. 6.00 Mar 15, 2006 page 293 of 570
REJ09B0211-0600

Advertisement

Table of Contents
loading

This manual is also suitable for:

H8s/2600 seriesH8s/2612 seriesH8s/2612 f-ztat

Table of Contents