EasyManua.ls Logo

Holtek HT46R47 - Configuring the Timer;Event Counter Input Clock Source

Holtek HT46R47
162 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
HT46R47
HT46C47
HT46R22
HT46C22
HT46R23
HT46C23
HT46R24
HT46R24
No. of 8-bit Timers 11
¾¾
Timer Register Name TMR TMR
¾¾
Timer Control Register TMRC TMRC
¾¾
No. of 16-bit Timers
¾¾
12
Timer Register Name
¾¾
TMRL/TMRH
TMR0L/TMR0H
TMR1L/TMR1H
Timer Control Register
¾¾
TMRC
TMR0C
TMR1C
An external clock source is used when the timer is in the event counting mode, the clock source be
-
ing provided on the external timer pin known as TMR, TMR0 or TMR1 depending on which device
is selected. These external pins may be pin-shared with other I/O pins depending upon which de
-
vice and package is chosen. Depending upon the condition of the TE, T0E or T1E bit in the corre
-
sponding timer control register, each high to low, or low to high transition on the external timer
input pin will increment the counter by one. Note that the 28-pin package HT46R24/HT46C24 de
-
vices, although having two internal Timer/Event Counters, have only one external timer pin TMR1;
due to packaging limitations the TMR0 pin is not available.
Configuring the Timer/Event Counter Input Clock Source
The internal timer¢s clock source can originate from either the system clock or from an external
clock source, with the exception of TMR0 in the 28-pin package HT46R24/HT46C24 devices. The
system clock input timer source is used when the timer is in the timer mode or in the pulse width
measurement mode. With the exception of TMR1 in the HT46R24/HT46C24 devices, whose timer
clock source is f
SYS
/4 and has no prescaler, the timer clock source is f
SYS
divided by the value in the
prescaler, the division ratio of which is conditioned by the bits PSC2~PSC0 or T0PSC2~T0PSC0.
An external clock source is used when the timer is in the event counting mode, the clock source be-
ing provided on an external timer pin, TMR, TMR0 or TMR1 depending upon which device and
which timer is used. Depending upon the condition of the TE, T0E or T1E bit, each high to low, or
low to high transition on the external timer pin will increment the counter by one. Note that as the
28-pin package HT46R24/HT46C24 devices has only one TMR1 external timer pin, its TMR0 inter-
nal timer cannot have an external clock source.
Chapter 1 Hardware Structure
35
T M R i n p u t
T E
T i m e r / E v e n t C o u n t e r
M o d e C o n t r o l
T O N
P r e l o a d R e g i s t e r
T i m e r / E v e n t
C o u n t e r
D a t a B u s
R e l o a d
O v e r f l o w
t o I n t e r r u p t
2
8 - s t a g e p r e s c a l e r
P S C 2 ~ P S C 0
( 1 / 1 ~ 1 / 1 2 8 )
8 - B i t T i m e r / E v e n t C o u n t e r
T M 1 T M 0
f
S Y S
P F D
¸
8-bit Timer/Event Counter Structure - HT46R47/HT46C47 and HT46R22/HT46C22 TMR

Table of Contents