Normal Tpc Output - Hitachi H8/3032 Series Hardware Manual

Table of Contents

Advertisement

9.3.3 Normal TPC Output

Sample Setup Procedure for Normal TPC Output: Figure 9-4 shows a sample procedure for
setting up normal TPC output.
ITU setup
Port and
TPC setup
ITU setup
Downloaded from
Elcodis.com
electronic components distributor
Normal TPC output
Select GR functions
Set GRA value
Select counting operation
Select interrupt request
Set initial output data
Select port output
Enable TPC output
Select TPC output trigger
Set next TPC output data
Start counter
Compare match?
Yes
Set next TPC output data
Figure 9-4 Setup Procedure for Normal TPC Output (Example)
1
1.
Set TIOR to make GRA an output compare
register (with output inhibited).
2.
Set the TPC output trigger period.
2
3.
Select the counter clock source with bits
TPSC2 to TPSC0 in TCR. Select the counter
3
clear source with bits CCLR1 and CCLR0.
4.
Enable the IMFA interrupt in TIER.
4
5.
Set the initial output values in the DR bits
of the input/output port pins to be used for
TPC output.
5
6.
Set the DDR bits of the input/output port
pins to be used for TPC output to 1.
6
7.
Set the NDER bits of the pins to be used for
TPC output to 1.
8.
Select the ITU compare match event to be
7
used as the TPC output trigger in TPCR.
9.
Set the next TPC output values in the NDR bits.
8
10.
Set the STR bit to 1 in TSTR to start the
timer counter.
11.
At each IMFA interrupt, set the next output
9
values in the NDR bits.
10
No
11
288

Advertisement

Table of Contents
loading

Table of Contents