English
Language : 

GMS81504 Datasheet, PDF (26/54 Pages) List of Unclassifed Manufacturers – CMOS SINGLE-CHIP 8-BIT MICROCONTROLLER
GMS81504
HYUNDAI MicroElectronics
TIMER/COUNTER
The GMS81504 has two Timer/Counter registers.
Each module can generate an interrupt to indicate that
an event has occurred (i.e. timer match).
Timer 0 and Timer 1 are can be used either the two
8-bit Timer/Counter or one 16-bit Timer/Counter to
combine them.
In the "timer" function, the register is incremented
every internal clock input. Thus, one can think of it as
counting internal clock input. Since a least clock con-
sists of 4 and most clock consists of 64 oscillator
periods, the count rate is 1/4 to 1/64 of the oscillator
frequency.
In the "counter" function, the register is incremented
in response to a 1-to-0 (falling edge) transition at its
corresponding external input pin, EC0.
In addition the "capture" function, the register is incre-
mented in response external or internal clock sources
same with timer or counter function. When external
clock edge input, the count register is captured into
Timer data register correspondingly.
It has four operating modes: "8-bit timer/counter",
"16-bit timer/counter", "8-bit capture", "16-bit cap-
ture" which are selected by bit in Timer mode register
TM0 as shown in right Table.
TM0 FOR TIMER 0, TIMER 1
CAP0 T1SL1 T1SL0
Timer 0
Timer 1
0 0 0 16-bit Timer/Counter
1 0 0 16-bit Capture
0 X X 8-bit Timer
8-bit Timer
1 X X 8-bit Capture 8-bit Timer
EX)
When TM0: 00110111 (PRESCALER= 16)
TDR0: FAH = 250D
OSCILLATOR FREQ.= 4MHz
INTERRUPT PERIOD =
1
× 16 × 250 = 1ms
4 × 106 Hz
TDR0
00H
MATCH
(TDR0 = T0)
FA
F9
F8
F7
F6
F5
F4
F3
F2
F1
3
2
1
CLEAR
CLEAR
COUNT PULSE
PERIOD
4 us
CLEAR
TIME
TIMER 0
INTERRUPT
OCCUR INTERRUPT
INTERRUPT
PERIOD
OCCUR INTERRUPT
OCCUR INTERRUPT
Figure 13. Timer Count Operation Example
26