English
Language : 

GMS81C5108 Datasheet, PDF (53/102 Pages) Hynix Semiconductor – HYNIX SEMICONDUCTOR INC. 8-BIT SINGLE-CHIP MICROCONTROLLERS
GMS81C5108
12.2 16 Bit Timer/Counter Mode
The Timer register is running with 16 bits. A 16-bit timer/
counter register T0, T1 are increased from 0000H until it
matches TDR0, TDR1 and then resets to 0000H. The
match output generates Timer 0 interrupt not Timer 1 in-
terrupt.
The clock source of the Timer 0 is selected either internal
or external clock by bit T0CK2, T0CK1 and T0CK0.
In 16-bit mode, the bits T1CK1,T1CK0 and 16BIT of TM1
should be set to “1” respectively.
TM0
-
-
CAP0 T0CK2 T0CK1 T0CK0 T0CN T0ST
ADDRESS : 0E0H
RESET VALUE : --000000B
0
X
X
X
X
X
TM1
POL
X
16BIT
1
PWME
0
CAP1
0
T0CK[2:0]
Edge Detector
EC0
XIN
SXIN
0X
1X
2
SCMR[1:0]
÷2
÷4
÷8
÷ 32
÷ 128
÷ 512
÷ 1024
MUX
1
T0CN
T1CK1
1
T1CK0 T1CN T1ST
ADDRESS : 0E2H
RESET VALUE : 00000000B
1
X
X
X : The value “0” or “1” corresponding your operation.
T0ST
0 : Stop
1 : Clear and Start
T1 (8-bit)
T0 (8-bit)
CLEAR
COMPARATOR
TDR1 (8-bit) TDR0 (8-bit)
T0IF
TIMER 0
INTERRUPT
F/F
COMPO (R31)
PWMO
[PMR.6]
Figure 12-6 16-bit Timer / Counter Mode
12.3 8-Bit Capture Mode
The Timer 0 capture mode is set by bit CAP0 of timer
mode register TM0 (bit CAP1 of timer mode register TM1
for Timer 1) as shown in Figure 12-7.
As mentioned above, not only Timer 0 but Timer 1 can also
be used as a capture mode.
The Timer/Counter register is increased in response inter-
nal or external input. This counting function is same with
normal timer mode, and Timer interrupt is generated when
timer register T0 (T1) increases and matches TDR0
(TDR1).
This timer interrupt in capture mode is very useful when
the pulse width of captured signal is more wider than the
maximum period of Timer.
For example, in Figure 12-9, the pulse width of captured
signal is wider than the timer data value (FFH) over 2
times. When external interrupt is occurred, the captured
value (13H) is more little than wanted value. It can be ob-
tained correct value by counting the number of timer over-
flow occurrence.
Timer/Counter still does the above, but with the added fea-
ture that a edge transition at external input INTx pin causes
the current value in the Timer x register (T0,T1), to be cap-
tured into registers CDRx (CDR0, CDR1), respectively.
After captured, Timer x register is cleared and restarts by
hardware.
It has three transition modes: “falling edge”, “rising edge”,
“both edge” which are selected by interrupt edge selection
register IESR (Refer to External interrupt section). In addi-
tion, the transition at INTx pin generate an interrupt.
Note: The CDR0, TDR0 and T0 are in same address. In
the capture mode, reading operation is read the
CDR0 and in timer mode, reading operation is read
the T0. TDR0 is only for writing operation.
The CDR1, T1 are in same address, the TDR1 is lo-
cated in different address. In the capture mode,
reading operation is read the CDR1
50
JUNE 2001 Ver 1.0