
11. Timer 0/1/2
A96G166/A96A166/A96S166 User’s manual
88
11.1.3
8-bit capture mode
Timer 0 capture mode is set by configuring T0MS[1:0] as ‘1x’. Clock source can use the
internal/external clock. Basically, it has the same function as the 8-bit timer/counter mode has, and
the interrupt occurs when T0CNT equals to T0DR. T0CNTvalue is automatically cleared by match
signal and it can be also cleared by software (T0CC).
This timer interrupt in capture mode is very useful when the pulse width of captured signal is wider
than the maximum period of timer.
The capture result is loaded into T0CDR. In the timer 0 capture mode, timer 0 output (T0O) waveform
is not available.
According to EIPOL1 registers setting, the external interrupt EINT10 function is chosen. Of course,
the EINT10 pin must be set to an input port.
T0CDR and T0DR are in the same address. In the capture mode, reading operation readsT0CDR, not
T0DR and writing operation will update T0DR.
P
r
e
s
c
a
l
e
r
fx
M
U
X
fx/2
T0CNT(8Bit)
EC0
fx/4
fx/8
fx/32
fx/128
fx/512
fx/2048
3
T0CK[2:0]
T0EN
8-bit Timer 0 Counter
T0DR(8Bit)
Comparator
T0IFR
8-bit Timer 0 Data Registe r
INT_ACK
Clear
Match
MUX
T0CDR(8Bit)
Clear
FLAG10
(EIFLAG1.4)
2
T0MS[1:0]
2
T0MS[1:0]
INT_ACK
Clear
To in terru pt
block
To in terru pt
block
T0EN
-
T0MS1
T0MS0
T0CK2
T0CK1
T0CK0
T0CC
T0CR
1
-
1
x
x
x
x
x
ADDRES S : B2H
INITIAL VALUE: 0000_0000B
Clear
EINT10
EIPOL1[1:0]
2
Match signa l
T0CC
Figure 35. 8-bit Capture Mode for Timer 0