English
Language : 

HD6413007F20 Datasheet, PDF (348/798 Pages) Renesas Technology Corp – Hardware Manual Renesas 16-Bit Single-Chip Microcomputer H8 Family/H8/300H Series
9. 16-Bit Timer
Counter setup
Select counter clock
1
No
Type of counting?
Yes
Periodic counting
Free-running counting
Select counter clear source 2
Select output compare
register function
3
Set period
4
Start counter
5
Start counter
5
Periodic counter
Free-running counter
Figure 9.12 Counter Setup Procedure (Example)
1. Set bits TPSC2 to TPSC0 in 16TCR to select the counter clock source. If an external clock
source is selected, set bits CKEG1 and CKEG0 in 16TCR to select the desired edge(s) of
the external clock signal.
2. For periodic counting, set CCLR1 and CCLR0 in 16TCR to have 16TCNT cleared at GRA
compare match or GRB compare match.
3. Set TIOR to select the output compare function of GRA or GRB, whichever was selected
in step 2.
4. Write the count period in GRA or GRB, whichever was selected in step 2.
5. Set the STR bit to 1 in TSTR to start the timer counter.
Rev.5.00 Sep. 12, 2007 Page 318 of 764
REJ09B0396-0500