English
Language : 

HD6413008VF25 Datasheet, PDF (256/688 Pages) Renesas Technology Corp – Old Company Name in Catalogs and Other Documents
8. 16-Bit Timer
• Sample setup procedure for counter
Figure 8.12 shows a sample procedure for setting up a counter.
Counter setup
Select counter clock
1
No
Count operation
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 8.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.
Rev.4.00 Aug. 20, 2007 Page 210 of 638
REJ09B0395-0400