Non-Overlapping Tpc Output; Figure 10.6 Setup Procedure For Non-Overlapping Tpc Output (Example) - Hitachi H8/3062 Hardware Manual

Single-chip microcomputer h8/3062 series; h8/3062b series; h8/3062f-ztat series; h8/3064f-ztat series
Hide thumbs Also See for H8/3062:
Table of Contents

Advertisement

10.3.4

Non-Overlapping TPC Output

Sample Setup Procedure for Non-Overlapping TPC Output: Figure 10.6 shows a sample
procedure for setting up non-overlapping TPC output.
Select GR functions
16-bit timer
setup
Select counting operation
Select interrupt requests
Set initial output data
Set up TPC output
Enable TPC transfer
Port and
TPC setup
Select TPC transfer trigger
Select non-overlapping groups
Set next TPC output data
16-bit timer
setup
Compare match A?
Set next TPC output data

Figure 10.6 Setup Procedure for Non-Overlapping TPC Output (Example)

Non-overlapping
TPC output
Set GR values
Start counter
Yes
1
1.
Set TIOR to make GRA and GRB output
compare registers (with output inhibited).
2
2.
Set the TPC output trigger period in GRB
and the non-overlap margin in GRA.
3
3.
Select the counter clock source with bits
TPSC2 to TPSC0 in TCR. Select the counter
4
clear source with bits CCLR1 and 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 pins
7
to be used for TPC output to 1.
8
7.
Set the NDER bits of the pins to be used for
TPC output to 1.
9
8.
In TPCR, select the 16-bit timer compare
match event to be used as the TPC output
trigger.
10
9.
In TPMR, select the groups that will operate
in non-overlap mode.
11
10.
Set the next TPC output values in the NDR
bits.
11.
Set the STR bit to 1 in TSTR to start the timer
No
counter.
12.
At each IMFA interrupt, write the next output
value in the NDR bits.
12
343

Advertisement

Table of Contents
loading

Table of Contents