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

no-image

GMS81508B

Manufacturer Part Number
GMS81508B
Description
HYUNDAI MICRO ELECTRONICS 8-BIT SINGLE-CHIP MICROCONTROLLERS
Manufacturer
HYNIX [Hynix Semiconductor]
Datasheet
GMS81508B/16B/24B
8-bit Timer Mode
In the timer mode, the internal clock is used for counting
up. Thus, you can think of it as counting internal clock in-
put. The contents of TDRn are compared with the contents
of up-counter, Tn. If match is found, a timer 1 interrupt
(T1IF) is generated and the up-counter is cleared to 0.
Counting up is resumed after the up-counter is cleared.
As the value of TDRn is changeable by software, time in-
terval is set as you want
40
Timer 1 (T1IF)
Interrupt
Source clock
Up-counter
TDR1
T1IF interrupt
TDR1
Example: Make 1msinterrupt using by Timer0 at 8MHz
INTERRUPT PERIOD =
When
7D
0
TM0 = 0001 1111
TDR0 = 125
f
XIN
= 8 MHz
LDM
LDM
SET1
EI
0
D
Occur interrupt
Start count
= 7D
TM0,#1FH
TDR0,#125
T0E
B
8
H
(8-bit Timer mode, Prescaler divide ratio = 64)
0
106 Hz
n
1
Figure 11-4 Timer Mode Timing Chart
1
1
Figure 11-5 Timer Count Example
2
3
(TDR0 = T0)
MATCH
Interrupt period
= 8 s x 125
4
2
64
5
; divide by 64
; 8us x 125= 1ms
; Enable Timer 0 Interrupt
; Enable Master Interrupt
6
125 = 1 ms
3
7A
Occur interrupt
7B
7C
7D
Value of
TM[1:0]
n-2
00
01
10
11
Table 11-1 Timer Source clock Interrupt Time
8 s
n-1
Match
Detect
Count Pulse
Period
Clock
Source
f
f
f
f
EC1
XIN
XIN
XIN
n
Counter
Clear
0
4
16
64
1
Occur interrupt
HYUNDAI MicroElectronics
(At f
Resolution
2
1/f
XIN
EC1
0.5
=8 M Hz)
2
8
3
DEC. 1999 Ver 1.04
sec
us
us
us
4
Maximum Time
1/f
TIME
(At f
EC1
Setting
XIN
2048
=8 M Hz)
256
128
512
sec
us
us
us

Related parts for GMS81508B