NEC PD78P214 Manuale Utente

Pagina di 487
211
Chapter 7   Timer/Counter Units
7
Fig. 7-128  Compare Operation
7.4.6  Sample Applications
(1) Interval timer operation
Eight-bit timer/counter 3 can be used as an interval timer that generates an interrupt at intervals of a count
time specified beforehand.  Eight-bit timer/counter 3 can also be used for baud rate generation.
This interval timer has a resolution from 1.3 
µs to 85.3 µs, and can count up to 341 µs and 21.8 ms, respectively
(at internal system clock f
CLK
 = 6 MHz).
Fig. 7-129 shows the timing of interval timer operation.  Fig. 7-130 shows the setting of control registers for
interval timer operation.  Fig. 7-131 shows the setting procedure.
Fig. 7-129  Timing of Interval Timer Operation
Remark Interval = (n + 1) 
× x/f
CLK
,  0 
≤ n ≤ FFH
x = 8, 16, 32, 64, 128, 256, 512
0H
TM3
count value
n
Compare register 
(CR30)
INTC30
interrupt request
Interrupt accepted
Interrupt accepted
Cleared
Cleared
n
n
Count starts
Interval
Interval
TM3
count value
0H
CR30
Count starts
Cleared
(coincidence)
Cleared
(coincidence)
CR30
CE
←1
INTC30
interrupt request