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
Prescaler
Bits T0PSC0~T0PSC2 of the TMR0C register can be
used to define a division ratio for the internal clock
source of the Timer/Event Counter enabling longer time
out periods to be setup.
Buzzer Function
Operating similar to a programmable frequency divider,
the buzzer function within the microcontroller provides a
means of producing a variable frequency output suitable
for applications, such as piezo-buzzer driving or other
interfaces requiring a precise frequency generator.
BZ and BZ pins are a complimentary pair and pin-shared
with I/O pins, PA0 and PA1. The function is selected via
the CTRL0 register, however, if not selected, the pins can
operate as normal I/O pins. Note that the BZ pin is the in-
verse of the BZ pin generating a kind of differential output
and supplying more power to connected interfaces such
as buzzers. The CTRL0 register can select a single BZ
pin or the complimentary pair BZ and BZ.
The timer overflow signal is the clock source for the
buzzer circuit. The output frequency is controlled by load-
ing the required values into the timer prescaler and timer
registers to give the required division ratio. The counter
will begin to count-up from this preload register value until
full, at which point an overflow signal is generated, caus-
ing both the BZ and BZ outputs to change state. The
counter will then be automatically reloaded with the
preload register value and continue counting- up.
If the CTRL0 register has selected the buzzer function,
then for both buzzer outputs to operate, it is essential
that the Port A control register PAC bit 0 and PAC bit 1
are setup as outputs. If only one pin is setup as an out-
put, the other pin can still be used as a normal data input
pin. However, if both pins are setup as inputs then the
buzzer will not function. The buzzer outputs will only be
activated if bit PA0 is set to ²1². This output data bit is
used as the on/off control bit for the buzzer outputs.
Note that the BZ and BZ outputs will both be low if the
PA0 output data bit is cleared to ²0². The condition of
data bit PA1 has no effect on the overall control of the
BZ and BZ pins.
Using this method of frequency generation, and if a
crystal oscillator is used for the system clock, very pre-
cise values of frequency can be generated.
I/O Interfacing
The Timer/Event Counter, when configured to run in the
event counter or pulse width measurement mode, re-
quires the use of an external timer pin for its operation.
As this pin is a shared pin it must be configured correctly
to ensure that it is setup for use as a Timer/Event Coun-
ter input pin. This is achieved by ensuring that the mode
select bits in the Timer/Event Counter control register,
select either the event counter or pulse width measure-
ment mode. Additionally the corresponding PAC Port
Control Register bit must be set high to ensure that the
pin is setup as an input. Any pull-high resistor connected
to this pin will remain valid even if the pin is used as a
Timer/Event Counter input.
Programming Considerations
When configured to run in the timer mode, the internal
system clock is used as the timer clock source and is
therefore synchronised with the overall operation of the
microcontroller. In this mode when the appropriate timer
register is full, the microcontroller will generate an internal
interrupt signal directing the program flow to the respec-
tive internal interrupt vector. For the pulse width mea-
surement mode, the internal system clock is also used as
the timer clock source but the timer will only run when the
correct logic condition appears on the external timer input
pin. As this is an external event and not synchronised
with the internal timer clock, the microcontroller will only
see this external event when the next timer clock pulse
arrives. As a result, there may be small differences in
measured values requiring programmers to take this into
account during programming. The same applies if the
timer is configured to be in the event counting mode,
which again is an external event and not synchronised
with the internal system or timer clock.
T im e r O v e r flo w
B u z z e r C lo c k
P A 0 D a ta
B Z O u tp u t a t P A 0
B Z O u tp u t a t P A 1
Rev. 1.10
Buzzer Function
20
August 4, 2008

Share Link: 

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