203
Counter setup
Select counter clock
Count operation
Periodic counting
Select counter clear source
Select output compare
register function
Set period
Start counter
Free-running counting
Start counter
Periodic counter
Free-running counter
1
Yes
No
2
3
4
5
5
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.
5. Set the STR bit to 1 in TSTR to start the timer counter.
Содержание H8/3008
Страница 1: ...Hitachi 16 Bit Microcomputer H8 3008 Hardware Manual ADE 602 221 Rev 1 0 9 14 00 Hitachi Ltd ...
Страница 4: ......
Страница 17: ...xii ...
Страница 70: ...54 ...
Страница 114: ...98 ...
Страница 154: ...138 ...
Страница 314: ...298 ...
Страница 412: ...396 ...
Страница 496: ...480 ...