Renesas F-ZTAT H8 Series Hardware Manual page 370

Hide thumbs Also See for F-ZTAT H8 Series:
Table of Contents

Advertisement

Section 10 16-Bit Integrated Timer Unit (ITU)
Counter setup
Select counter clock
Type of counting?
Periodic counting
Select counter clear source
Select output compare
register function
Set period
Start counter
Periodic counter
1. Set bits TPSC2 to TPSC0 in TCR to select the counter clock source. If an
external clock source is selected, set bits CKEG1 and CKEG0 in TCR to
select the desired edge(s) of the external clock signal.
2. For periodic counting, set CCLR1 and CCLR0 in TCR to have TCNT 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. 3.00 Mar 21, 2006 page 342 of 814
REJ09B0302-0300
1
No
Yes
2
3
4
5
Figure 10.14 Counter Setup Procedure (Example)
Free-running counting
Start counter
Free-running counter
5

Advertisement

Table of Contents
loading

Table of Contents