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)
76543210
0
CRC2 1000000
Disables clearing TM2
Fig. 7-119 Setting of Control Registers for One-Shot Timer Operation
(a) Timer control register 1 (TMC1)
0H
INTC21
OVF2
OVF20
Count starts
CE21
TM2
count value Value of CR21
Cleared
FFH
76543210
CE2
TMC1 OVF2 10××××
One-shot timer mode
76543210
PRS23 ×
0
PRM1
Specifies count clock
(x/fCLK; where x = 16, 32, 64,
128, 256, 512,
or external clock)
PRS22 PRS21 PRS20 ××