Sample Applications; Timing Of Interval Timer Operation (1) - NEC PD78212 User Manual

8-bit single-chip microcomputer sub-series
Table of Contents

Advertisement

µ PD78214 Sub-Series

7.3.11 Sample Applications

(1) Interval timer operation (1)
By free running 8-bit timer 2 (TM2), and adding a value to a compare register (CR20, CR21) in an interrupt
handling routine, 8-bit timer/counter 2 can be used as an interval timer whose period is as long as the added
value. (See Fig. 7-96.)
In addition, 8-bit timer 2 (TM2) has two compare registers, so that interval timers with two types of periods
can be produced.
Fig. 7-97 shows the setting of control registers. Fig. 7-98 shows the setting procedure. Fig. 7-99 shows
interrupt handling.
TM2
count value
0H
Timer starts
Compare register
(CR20)
INTC20
interrupt request
Remark Interval = n × x/f
x = 16, 32, 64, 128, 256, 512
190
Fig. 7-96 Timing of Interval Timer Operation (1)
n
n
Interval
, 1 ≤ n ≤ FFH
CLK
FFH
MOD(2n)
MOD(2n)
Rewriting by inter-
Rewriting by inter-
rupt program
rupt program
Interval
Interval
FFH
MOD(3n)
MOD(3n)
MOD(4n)
Rewriting by inter-
rupt program

Advertisement

Table of Contents
loading

Table of Contents