129
Chapter 7 Timer/Counter Units
7
7.1.9 Sample Applications
(1) Interval timer operation (1)
By free running 16-bit timer 0 (TM0), and adding a value to a compare register (CR00, CR01) in an interrupt
handling routine, the 16-bit timer/counter can be used as an interval timer whose period is as long as the added
value. (See
Fig. 7-24
.)
This interval timer has a resolution of 1.3
µ
s, and can count up to 87.4 ms (at internal system clock f
CLK
= 6
MHz).
In addition, 16-bit timer 0 (TM0) has two compare registers, so that interval timers with two types of periods
can be produced.
Fig. 7-25 shows the setting of control registers. Fig. 7-26 shows the setting procedure. Fig. 7-27 shows
interrupt handling.
Fig. 7-24 Timing of Interval Timer Operation (1)
n
n
0H
TM0
count value
MOD(2n)
MOD(3n)
FFFFH
FFFFH
MOD(2n)
MOD(3n)
MOD(4n)
Timer starts
Compare register
(CR00)
INTC00
interrupt request
Rewriting by inter-
rupt program
Interval
Interval
Interval
Rewriting by inter-
rupt program
Rewriting by inter-
rupt program
Remark
Interval = n
×
8/f
CLK
, 1
≤
n
≤
FFFFH
Содержание PD78212
Страница 11: ......
Страница 53: ...24 ...
Страница 61: ...32 µPD78214 Sub Series 9 VSS Ground 10 NC non connection Not connected inside the chip ...
Страница 65: ...36 ...
Страница 83: ...54 ...
Страница 135: ...106 ...
Страница 271: ...242 ...
Страница 405: ...376 ...
Страница 417: ...388 ...
Страница 423: ...394 ...
Страница 449: ...420 ...
Страница 457: ...428 ...
Страница 471: ...442 ...
Страница 487: ...458 ...