English
Language : 

GMS81504 Datasheet, PDF (28/54 Pages) List of Unclassifed Manufacturers – CMOS SINGLE-CHIP 8-BIT MICROCONTROLLER
GMS81504
HYUNDAI MicroElectronics
8-bit Timer/Counter Mode
The GMS81504 has two 8-bit Timer/Counters, Timer
0, Timer 1. The Timer 0, Timer 1 only as shown in
Figure 15.
The "timer" or "counter" function is selected by control
registers TM0 as shown in Figure 17. To use as an
8-bit timer/counter mode, bit CAP0 of TM0 should be
cleared to "0" and bits T1SL1, T1SL0 of TM0 should
not set to zero (Figure 15).
These timers have each 8-bit count register and data
register. The count register is incremented by every
internal or external clock input. The internal clock has
a prescaler divide ratio option of 4, 16, 64 (selected by
control bits T1SL1, T1SL0 of register TM0).
In the Timer 0, timer register T0 increments from 00H
until it matches TDR0 and then reset to 00H. The match
output of Timer 0 generates Timer 0 interrupt (latched
in T0IF bit)
As TDRx and Tx register are in same address, when
reading it as a Tx, written to TDRx.
Caution:
The contents of Timer data register TDRx should
be initialized 1H~FFH except 0H, because it is un-
defined after reset.
In counter function, the counter is incremented every
1-to-0 (falling edge) transition of EC0 pin. In order to
use counter function, the bit EC0S of the Port mode
register PMR4 are set to "1". The Timer 0 can be used
as a counter by pin EC0 input, but Timer 1 can not.
EC0 PIN
XIN PIN
TM0
MSB
CAP0
0
T1ST T1SL1 T1SL0 T0ST
X
≠0 ≠0
X
LSB
T0CN T0SL1 T0SL0
X
X
X
ADDRESS: E2H
RESET VALUE: 00H
T0SL[1:0]
EDGE DETECTOR
"0"
÷4
÷ 16
÷ 64
PRESCALER
MUX
"1"
T0CN
TIMER 0
T0ST
0: Stop
1: Clear and Start
T0 (8-BITS)
CLEAR
COMPARATOR
T0IF
TDR0 (8-BITS)
TIMER 0
INTERRUPT
T1SL[1:0]
MUX
T1ST
0: Stop
1: Clear and Start
T1 (8-BITS)
CLEAR
TIMER 1
COMPARATOR
TDR1 (8-BITS)
T1IF
F/F
TIMER 1
INTERRUPT
T1O PIN
Figure 15. 8-bit Timer/Counter Mode
28