GMS81C5108
15. Buzzer Output Function
The buzzer driver consists of 6-bit binary counter, the
buzzer data register BDR and the clock selector. It gener-
ates square-wave which is very wide range frequency (500
Hz~125 KHz at fMAIN = 4MHz) by user programmable
counter.
The bit 0 to 5 of BDR determines output frequency for
buzzer driving. BCD is undefined after reset, so it must be
initialized to between 0H and 3FH by software. Note that
BDR is a write-only register. Frequency calculation is fol-
lowing as shown below.
Pin R04 is assigned for output port of Buzzer driver by set-
ting the bit BUZ of Port Mode Register (PMR) to “1”.
Oscillator Frequency
2 × Prescaler Ratio × (BCD + 1)
f
BUZ(Hz) = ------------------------------------------------------------------------------
The 6-bit buzzer counter is cleared and start the counting
by writing signal to the register BDR. It is increased from
00H until it matches with BDR[5:0].
The bits BCK1, BCK0 of BDR select the source clock
from prescaler output
f
: BUZ pin frequency
BUZ
Also, it is cleared by counter overflow and count up to out-
put the square wave pulse of duty 50%.
Prescaler ratio: Prescaler divide ratio by BDR[7:6]
BCD value: 6-bit compare data, BCD[5:0].
BDR (Buzzer Data Register)
W
7
W
6
W
5
W
4
W
3
W
2
W
1
W
0
Bit :
ADDRESS : 0FD
RESET VALUE : 00
H
BCK1
BCK0
BCD5
BCD4
BCD3
BCD2
BCD1
BCD0
H
Bit manipulation is not available.
BCK[1:0] (Buzzer Clock Source)
3
4
5
6
3
4
5
6
00: fMAIN÷2
01: fMAIN÷2
10: fMAIN÷2
11: fMAIN÷2
or fSUB÷2
or fSUB÷2
or fSUB÷2
or fSUB÷2
BCD[5:0] (Buzzer Control Data)
Buzzer Period Data
PMR (Port Mode Register)
ADDRESS :0D9
RESET VALUE : -0-00000
H
-
PWMO
-
EC0 INT2 INT1 INT0
BUZ
B
BUZ (Buzzer Output)
0: R04 Port (turn off buzzer)
1: BUZ port (turn on buzzer)
SCMR[1:0]
2
÷ 8
X
IN
IN
0X
1X
÷ 16
÷ 32
÷ 64
COUNTER (6-bit)
MUX
SX
F/F
BCK[1:0]
COMPARATOR
R04/BUZ PIN
BUZ
[PMR.4]
BCD (6-bit)
Figure 15-1 Buzzer Driver
Example: 2.5kHz output at 4MHz.
LDM
LDM
LDM
R0DR,#XXX1_XXXXB
BDR,#1001_1000B
PMR,#XXX1_XXXXB
;Buzzer ON
X means don’t care
60
JUNE 2001 Ver 1.0