English
Language : 

GMS82524 Datasheet, PDF (41/93 Pages) Hynix Semiconductor – 8-BIT SINGLE-CHIP MICROCONTROLLERS
GMS82512/16/24
HYUNDAI MicroElectronics
8-bit Event Counter Mode
In this mode, counting up is started by an external trigger.
This trigger means falling edge of the EC0 pin input.
Source clock is used as an internal clock selected with tim-
er mode register TM0. The contents of timer data register
TDRn (n = 0,1) are compared with the contents of the up-
counter Tn. If a match is found, an timer interrupt request
flag TnIF is generated, and the counter is cleared to “0”.
The counter is restart and count up continuously by every
falling edge of the EC0 pin input.
The maximum frequency applied to the EC0 pin is fXIN/2
[Hz].
Start count
EC0 pin input
Up-counter
TDR1
T1IF interrupt
0
1
2
n
In order to use event counter function, the bit 4 of the Port
Mode Register PMR4(address 0D0H) is required to be set
to “1”.
After reset, the value of timer data register TDRn is unde-
fined, it should be initialized to between 1H~FFHnot to
"0"The interval period of Timer is calculated as below
equation.
Period (sec)
=
-----1-----
fXIN
×
2
×
Divide
Ratio
×
TDRn
n-1 n 0
1
2
Figure 11-6 Event Counter Mode Timing Chart
TDR1
Timer 1 (T1IF)
Interrupt
T1ST
Start & Stop
T1CN
Control count
clear & start
stop
~~
disable enable
~~
up-count
Occur interrupt
Occur interrupt
T1ST = 1
T1ST = 0
T1CN = 0
T1CN = 1
Figure 11-7 Count Operation of Timer / Event counter
TIME
38
FEB. 2000 Ver 1.00