Normal Tpc Output - Hitachi H8/3062 Hardware Manual

Single-chip microcomputer
Hide thumbs Also See for H8/3062:
Table of Contents

Advertisement

10.3.3

Normal TPC Output

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

Advertisement

Table of Contents
loading

Table of Contents