DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

48R01A3 데이터 시트보기 (PDF) - Holtek Semiconductor

부품명
상세내역
제조사
48R01A3
Holtek
Holtek Semiconductor Holtek
48R01A3 Datasheet PDF : 49 Pages
First Prev 11 12 13 14 15 16 17 18 19 20 Next Last
HT48R01A
Timer/Event Counters
The provision of timers form an important part of any
microcontroller, giving the designer a means of carrying
out time related functions. The device contains one
count-up timer of 8-bit capacity. As the timer has three
different operating modes, it can be configured to oper-
ate as a general timer, an external event counter or as a
pulse width measurement device. The provision of an
internal prescaler to the clock circuitry gives added
range to the timer.
There are two types of registers related to the
Timer/Event Counters. The first is the register that con-
tains the actual value of the timer and into which an ini-
tial value can be preloaded. Reading from this register
retrieves the contents of the Timer/Event Counter. The
second type of associated register is the Timer Control
Register which defines the timer options and deter-
mines how the timer is to be used. The device can have
the timer clock configured to come from the internal
clock source. In addition, the timer clock source can also
be configured to come from an external timer pin.
An external clock source is used when the timer is in the
event counting mode, the clock source being provided
on the external timer pin, known as TMR0. These exter-
nal timer pins are pin-shared with other I/O pins. De-
pending upon the condition of the T0E bit in the Timer
Control Register, each high to low, or low to high transi-
tion on the external timer input pin will increment the
counter by one.
Configuring the Timer/Event Counter Input Clock
Source
The internal timer¢s clock can originate from various
sources, depending upon which device and which timer
is chosen. The system clock input timer source is used
when the timer is in the timer mode or in the pulse width
measurement mode. For Timer/Event Counter 0 this
system clock timer source is first divided by a prescaler,
the division ratio of which is conditioned by the Timer
Control Register bits T0PSC0~T0PSC2.
An external clock source is used when the timer is in the
event counting mode, the clock source being provided
on an external timer pin TMR0 or TMR1, depending
upon which device and which timer is used. Depending
upon the condition of the T0E bit, each high to low, or
low to high transition on the external timer pin will incre-
ment the counter by one.
Timer Registers - TMR0
The timer registers are special function registers located
in the Special Purpose Data Memory and is the place
where the actual timer value is stored. This register is
known as TMR0. The value in the timer registers in-
creases by one each time an internal clock pulse is re-
ceived or an external transition occurs on the external
timer pin. The timer will count from the initial value loaded
by the preload register to the full count of FFH at which
point the timer overflows and an internal interrupt signal is
generated. The timer value will then be reset with the ini-
tial preload register value and continue counting.
Note that to achieve a maximum full range count of FFH,
the preload register must first be cleared to all zeros. It
should be noted that after power-on, the preload regis-
ters will be in an unknown condition. Note that if the
Timer/Event Counters are in an OFF condition and data
is written to their preload registers, this data will be im-
mediately written into the actual counter. However, if the
counter is enabled and counting, any new data written
into the preload data registers during this period will re-
main in the preload registers and will only be written into
the actual counter the next time an overflow occurs.
Timer Control Registers - TMR0C
The flexible features of the Holtek microcontroller
Timer/Event Counters enable them to operate in three
different modes, the options of which are determined by
the contents of their respective control register.
The Timer Control Register is known as TMR0C. It is the
Timer Control Register together with its corresponding
timer register that control the full operation of the
Timer/Event Counter. Before the timer can be used, it is
essential that the Timer Control Register is fully pro-
grammed with the right data to ensure its correct opera-
tion, a process that is normally carried out during
program initialisation.
To choose which of the three modes the timer is to oper-
ate in, either in the timer mode, the event counting mode
fS Y S
R T C O s c illa to r
T0S
D a ta B u s
T0P S C 2~T0P S C 0
T0M 1 T0M 0
(1 /2 ~ 1 /2 5 6 )
M
U
X
8 - s ta g e p r e s c a le r
T im e r /E v e n t C o u n te r
M o d e C o n tro l
T0O N
TM R 0
P r e lo a d R e g is te r
R e lo a d
T im e r /E v e n t C o u n te r
¸2
O v e r flo w
to In te rru p t
B uzzer
T0E
8-bit Timer/Event Counter Structure
Rev. 1.10
17
August 4, 2008

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]