HT56R22/HT56R23/HT56R24/HT56R25/HT56R26
Buzzer
Operating in a similar way to the Programmable Fre-
quency Divider, the Buzzer function provides a means
of producing a variable frequency output, suitable for
applications such as Piezo-buzzer driving or other ex-
ternal circuits that require a precise frequency genera-
tor. The BZ and BZ pins form a complementary pair, and
are pin-shared with I/O pins, PB4 and PB5. A configura-
tion option is used to select from one of three buzzer op-
tions. The first option is for both pins PB4 and PB5 to be
used as normal I/Os, the second option is for both pins
to be configured as BZ and BZ buzzer pins, the third op-
tion selects only the PB4 pin to be used as a BZ buzzer
pin with the PB5 pin retaining its normal I/O pin function.
Note that the BZ pin is the inverse of the BZ pin which to-
gether generate a differential output which can supply
more power to connected interfaces such as buzzers.
The buzzer is driven by the internal clock source, , which
then passes through a divider, the division ratio of which
is selected by configuration options to provide a range of
buzzer frequencies from fS/22 to fS/29. The clock source
that generates fS, which in turn controls the buzzer fre-
quency, can originate from three different sources, the
32768Hz oscillator, the 32K_INT oscillator or the Sys-
tem oscillator/4, the choice of which is determined by
the fS clock source configuration option. Note that the
buzzer frequency is controlled by configuration options,
which select both the source clock for the internal clock
fS and the internal division ratio. There are no internal
registers associated with the buzzer frequency.
If the configuration options have selected both pins PB4
and PB5 to function as a BZ and BZ complementary pair
of buzzer outputs, then for correct buzzer operation it is
essential that both pins must be setup as outputs by set-
ting bits PBC4 and PBC5 of the PBC port control regis-
ter to zero. The PB4 data bit in the PB data register must
also be set high to enable the buzzer outputs, if set low,
both pins PB4 and PB5 will remain low. In this way the
single bit PB4 of the PB register can be used as an
on/off control for both the BZ and BZ buzzer pin outputs.
Note that the PB5 data bit in the PB register has no con-
trol over the BZ buzzer pin PB5.
fS Y S /4
32768H z
3 2 K _ IN T
fS S o u rc e
C o n fig u r a tio n
O p tio n
fS
C o n fig u r a tio n O p tio n
D iv id e b y 2 2 ~ 2 9
BZ
BZ
Buzzer Function
PB4/PB5 Pin Function Control
PBC Register
PBC4
PBC Register
PBC5
0
0
0
0
0
1
0
1
1
0
1
1
²x² stands for don¢t care
²D² stands for Data ²0² or ²1²
PB Data Register
PB4
1
PB Data Register
PB5
x
0
x
1
x
0
x
x
D
x
x
Output
Function
PB4=BZ
PB5=BZ
PB4=²0²
PB5=²0²
PB4=BZ
PB5=input line
PB4=²0²
PB5=input line
PB4=input line
PB5=D
PB4=input line
PB4=input line
Rev. 1.30
81
December 26, 2014