MC80F0304/08/16
92
November 4, 2011 Ver 2.12
17. BUZZER FUNCTION
The buzzer driver block consists of 6-bit binary counter, buzzer
register BUZR, and clock source selector. It generates square-
wave which has very wide range frequency (488Hz ~ 250kHz at
f
XIN
= 4MHz) by user software.
A 50% duty pulse can be output to R12 / BUZO pin to use for pi-
ezo-electric buzzer drive. Pin R12 is assigned for output port of
Buzzer driver by setting the bit 2 of PSR1(address 0F9
H
) to “1”.
For PSR1 register, refer to Figure 17-2 .
Example: 5kHz output at 4MHz.
LDM
BUZR,#0011_0001B
LDM
PSR1,#XXXX_X1XXB
X means don’t care
The bit 0 to 5 of BUZR determines output frequency for buzzer
driving.
Equation of frequency calculation is shown below.
f
BUZ
: Buzzer frequency
f
XIN
: Oscillator frequency
Divide Ratio: Prescaler divide ratio by BUCK[1:0]
BUR: Lower 6-bit value of BUZR. Buzzer period value.
The frequency of output signal is controlled by the buzzer control
register BUZR. The bit 0 to bit 5 of BUZR determine output fre-
quency for buzzer driving.
Figure 17-1 Block Diagram of Buzzer Driver
Figure 17-2 Buzzer Register & PSR1
f
BUZ
f
XIN
2
DivideRatio
BUR
1
+
(
)
×
×
---------------------------------------------------------------------------------
=
P
rescaler
÷
8
÷
32
÷
16
÷
64
BUR
R12/BUZO PIN
PSR1
Internal bus line
R12 port data
X
IN
PIN
2
6
[0E0
H
]
[0F9
H
]
0
1
F/F
Comparator
Compare data
6-BIT BINARY
MUX
00
01
10
11
Port selection register 1
MUX
BUZO
COUNTER
BUR[5:0]
BUZR
ADDRESS: 0E0
H
RESET VALUE: 0FF
H
W
W
W
W
W
W
Source clock select
00: f
XIN
÷
8
01: f
XIN
÷
16
10: f
XIN
÷
32
11: f
XIN
÷
64
Buzzer Period Data
W
W
BUCK1 BUCK0
PSR1
ADDRESS: 0F9
H
RESET VALUE: ---- 0000
B
BUZO
R12 / BUZO Selection
0: R12 port (Turn off buzzer)
1: BUZO port (Turn on buzzer)
-
-
-
-
-
-
-