English
Language : 

H49R50A-1 Datasheet, PDF (17/45 Pages) Holtek Semiconductor Inc – LCD Type 8-Bit MCU
HT49R50A-1/HT49C50-1/HT49C50L
Timer/Event Counter
Two timer/event counters are implemented in the de-
vices. Both of them contain an 8-bit programmable
count-up counter.
The timer/event counter 0 clock source may come from
the system clock or system clock/4 or RTC time-out sig-
nal or external source. System clock source or system
clock/4 is selected by option.
The timer/event counter 1 clock source may come from
TMR0 overflow or system clock or time base time-out
signal or system clock/4 or external source, and the
three former clock source is selected by option. Using
external clock input allows the user to count external
events, measure time internals or pulse widths, or gen-
erate an accurate time base. While using the internal
clock allows the user to generate an accurate time base.
The two timer/event counters are operated almost in the
same manner, except the clock source and related reg-
isters.
There are two registers related to the Timer/Event
Counter 0, i.e., TMR0 ([0DH]) and TMR0C ([0EH]), and
two registers related to the Timer/Event Counter 1, i.e.,
TMR1 ([10H], and TMR1C ([11H]). There are also two
physical registers are mapped to TMR0 (TMR1) loca-
tion; writing TMR0 (TMR1) places the starting value in
the timer/event counter preload register, while reading it
yields the contents of the timer/event counter. TMR0C
and TMR1C are timer/event counter control registers
used to define some options.
The T0M0 and T0M1 (T1M0 and T1M1) bits define the
operation mode. The event count mode is used to count
external events, which means that the clock source is
from an external (TMR0, TMR1) pin. The timer mode
functions as a normal timer with the clock source com-
ing from the internal selected clock source. Finally, the
pulse width measurement mode can be used to count
the high or low level duration of the external signal
(TMR0, TMR1), and the counting is based on the inter-
nal selected clock source.
S y s te m C lo c k
S y s te m C lo c k /4
O p tio n
S e le c t
R TC O ut
T0S
TM R 0
M
U
X
T0M 1
T0M 0
T0E
D a ta b u s
T im e r /E v e n t C o u n te r 0 R e lo a d
P r e lo a d R e g is te r
T0M 1
T0M 0
T0O N
P u ls e W id th
M e a s u re m e n t
M o d e C o n tro l
T im e r /E v e n t
C o u n te r 0
Timer/Event Counter 0
O v e r flo w
T o In te rru p t
PFD 0
T M R 0 O v e r flo w
S y s te m C lo c k
T im e B a s e O u t
O p tio n
S e le c t
S y s te m C lo c k /4
T1S
TM R 1
M
U
X
T1M 1
T1M 0
T1E
D a ta b u s
T im e r /E v e n t C o u n te r 1 R e lo a d
P r e lo a d R e g is te r
T1M 1
T1M 0
T1O N
P u ls e W id th
M e a s u re m e n t
M o d e C o n tro l
T im e r /E v e n t
C o u n te r 1
Timer/Event Counter 1
O v e r flo w
T o In te rru p t
PFD 1
PFD 0
PFD 1
M
U
1 /2
PFD
X
P A 3 D a ta C T R L
P F D S o u r c e O p tio n
PFD Source Option
Rev. 2.00
17
November 29, 2005