GMS81508B HYNIX [Hynix Semiconductor], GMS81508B Datasheet - Page 41

no-image

GMS81508B

Manufacturer Part Number
GMS81508B
Description
HYUNDAI MICRO ELECTRONICS 8-BIT SINGLE-CHIP MICROCONTROLLERS
Manufacturer
HYNIX [Hynix Semiconductor]
Datasheet
GMS81508B/16B/24B
11.1 8-bit Timer / Counter Mode
The GMS815xxB has four 8-bit Timer/Counters, Timer 0,
Timer 1, Timer 2, Timer 3. The Timer 0, Timer 1 are
shown in Figure .
The “timer” or “counter” function is selected by control
registers TM0, TM2 as shown in Table 11-1 and Table 11-
2. To use as an 8-bit timer/counter mode, bit CAP0 of TM0
is cleared to “0” and bits T1SL1, T1SL0 of TM0 or bits
Example 1:
Timer0 = 4ms 8-bit timer mode at 4MHz
Timer1 = 1ms 8-bit timer mode at 4MHz
38
EC0 PIN
XIN PIN
LDM
LDM
LDM
SET1
SET1
EI
TM0
TDR0,#250
TDR1,#250
TM0,#0110_1111B
T0E
T1E
CAP0
7
0
#16
#64
#4
#16
#64
#4
T1ST
X
6
T0SL[1:0]
T1SL[1:0]
00
01
10
11
01
10
11
MUX
T1SL1 T1SL0
MUX
5
Figure 11-2 8-bit Timer/Counter 0, 1
01 or 10 or 11
4
TIMER 0
TIMER 1
T0CN
BTCL
T0ST
X
3
T0CN
2
X
T0SL1
X means don’t care
X
1
TDR0 (8-bit)
TDR1 (8-bit)
T0 (8-bit)
T1 (8-bit)
T3SL1, T3SL0 of TM2 should not set to zero. These timers
have each 8-bit count register and data register. The count
register is increased by every internal or external clock in-
put. The internal clock has a prescaler divide ratio option
of 4, 16, 64 (selected by control bits TxSL1, TxSL0 of reg-
ister TMx).
Example 2:
Timer0 = 8-bit event counter mode
Timer1 = 1ms 8-bit timer mode at 4MHz
T0SL0
T0ST
T1ST
0
X
0: Stop
1: Clear and start
0: Stop
1: Clear and start
Comparator
Comparator
ADDRESS: 0E2
INITIAL VALUE: 00
LDM
LDM
LDM
SET1
SET1
EI
clear
clear
TDR0,#250
TDR1,#250
TM0,#0110_1100B
T0E
T1E
T0IF
HYUNDAI MicroElectronics
H
H
T1IF
F/F
DEC. 1999 Ver 1.04
TIMER 0
INTERRUPT
TIMER 1
INTERRUPT
T1O PIN

Related parts for GMS81508B