Chapter 7 timer/counter units – NEC PD78214 User Manual
Page 232
203
Chapter 7 Timer/Counter Units
7
(7) One-shot timer operation
When functioning as a one-shot timer, 8-bit timer/counter 2 generates only one interrupt when a specified
count time has elapsed after the start of 8-bit timer 2 (TM2). (See Fig. 7-118.)
An additional one-shot timer operation can be started by clearing the OVF2 bit of timer control register 1
(TMC1).
Fig. 7-119 shows the setting of control registers. Fig. 7-120 shows the setting procedure. Fig. 7-121 shows
the procedure for starting an additional one-shot operation.
Fig. 7-118 One-Shot Timer Operation
(b) Prescaler mode register 1 (PRM1)
(c) Capture/compare control register 2 (CRC2)
7
6
5
4
3
2
1
0
0
CRC2
1
0
0
0
0
0
0
Disables clearing TM2
Fig. 7-119 Setting of Control Registers for One-Shot Timer Operation
(a) Timer control register 1 (TMC1)
0H
INTC21
OVF2
OVF2
←0
Count starts
CE2
←1
TM2
count value
Value of CR21
Cleared
FFH
7
6
5
4
3
2
1
0
CE2
TMC1
OVF2
1
0
Ч
Ч
Ч
Ч
One-shot timer mode
7
6
5
4
3
2
1
0
PRS23
×
0
PRM1
Specifies count clock
(x/f
CLK
; where x = 16, 32, 64,
128, 256, 512,
or external clock)
PRS22 PRS21 PRS20
Ч
Ч