SN8P2740 Series
ADC, OP-amp, Comparator 8-Bit Micro-Controller
122K/4K BUZZER GENERATOR
12.1 OVERVIEW
The MCU builds in Buzzer generator to drive external buzzer device. The buzzer generator purpose is to drive 2KHz or
4KHz buzzer. Adjusting buzzer output frequency is through BZM register. The buzzer output pin is shared with GPIO.
When BZEN = 1, the pin outputs buzzer carry signal. When BZEN = 0, the pin returns to GPIO last condition (input
mode, output high or output low status).
GPIO
BZrate [1:0]
Fcpu/256
Fcpu/512
Fcpu/1024
Fcpu/2048
Pin
Fcpu
BZEN
The buzzer frequency is divided from Fcpu (instruction cycle) controlled by BZrate bits, and Fcpu decides the buzzer
frequency. The selection table is as following.
Buzzer Rate
Fcpu = 2MHz
8KHz
Buzzer Rate
Division
Fcpu/256
Fcpu/512
Fcpu/1024
Fcpu/2048
BZrate [1:0]
Fcpu = 1MHz
4KHz
Fcpu = 4MHz
16KHz
00
01
10
11
2KHz
1KHz
0.5KHz
4KHz
2KHz
1KHz
8KHz
4KHz
2KHz
The buzzer target frequency is 2KHz and 4KHz. It is important to choice a good Fcpu rate to obtain the correct buzzer
frequency. The above table shows 2KHz/4KHz buzzer frequency configurations.
12.2 BZM REGISTER
0DCH
BZM
Read/Write
After reset
Bit 7
BZEN
R/W
0
Bit 6
BZrate1
R/W
Bit 5
BZrate0
R/W
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
0
0
Bit 7
BZEN: Buzzer output control bit.
0 = Disable BZ output and BZ output pin transfers to I/O last status.
1 = Enable BZ output and disable GPIO function.
Bit[6:5]
BZrate[1:0]: Buzzer rate control bits.
00 = Fcpu/256
01 = Fcpu/512
10 = Fcpu/1024
11 = Fcpu/2048
Note:
1. If BZEN=0, the buzzer output pin is GPIO mode and returns to last status after disabling buzzer
output.
2. If BZEN=1, the buzzer output pin is buzzer output function and isolates the GPIO function.
SONiX TECHNOLOGY CO., LTD
Page 107
Version 2.0