![Hynix Semiconductor GMS81C5108 User Manual Download Page 63](http://html1.mh-extra.com/html/hynix-semiconductor/gms81c5108/gms81c5108_user-manual_2192989063.webp)
GMS81C5108
60
JUNE 2001 Ver 1.0
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 f
MAIN
= 4MHz) by user programmable
counter.
Pin R04 is assigned for output port of Buzzer driver by set-
ting the bit BUZ of Port Mode Register (PMR) to “1”.
The 6-bit buzzer counter is cleared and start the counting
by writing signal to the register BDR. It is increased from
00
H
until it matches with BDR[5:0].
Also, it is cleared by counter overflow and count up to out-
put the square wave pulse of duty 50%.
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 0
H
and 3F
H
by software. Note that
BDR is a write-only register. Frequency calculation is fol-
lowing as shown below.
The bits BCK1, BCK0 of BDR select the source clock
from prescaler output
f
BUZ
: BUZ pin frequency
Prescaler ratio: Prescaler divide ratio by BDR[7:6]
BCD value: 6-bit compare data, BCD[5:0].
Figure 15-1 Buzzer Driver
Example: 2.5kHz output at 4MHz.
LDM
R0DR,#XXX1_XXXXB
LDM
BDR,#1001_1000B
LDM
PMR,#XXX1_XXXXB ;Buzzer ON
X means don’t care
f
BUZ
Hz
(
)
Oscillator Frequency
2
Prescaler Ratio
BCD
1
+
(
)
×
×
-------------------------------------------------------------------------------
=
BDR (Buzzer Data Register)
ADDRESS : 0FD
H
RESET VALUE : 00
H
BCK1
BCK0
BCD5
BCD4
BCD3
BCD2
BCD1
BCD0
÷
64
÷
16
÷
32
MUX
COUNTER (6-bit)
BCD (6-bit)
F/F
COMPARATOR
BCK[1:0]
R04/BUZ PIN
÷
8
BCK[1:0] (Buzzer Clock Source)
BCD[5:0] (Buzzer Control Data)
BUZ
[PMR.4]
Bit manipulation is not available.
Buzzer Period Data
Bit : 7 6 5 4 3 2 1 0
W
W
W
W
W
W
W
W
SX
IN
0X
1X
X
IN
SCMR[1:0]
2
PMR (Port Mode Register)
ADDRESS :0D9
H
RESET VALUE : -0-00000
B
-
PWMO
-
BUZ
EC0
INT2
INT1
INT0
BUZ (Buzzer Output)
0: R04 Port (turn off buzzer)
1: BUZ port (turn on buzzer)
00: f
MAIN
÷
2
3
01: f
MAIN
÷
2
4
10: f
MAIN
÷
2
5
11: f
MAIN
÷
2
6
or f
SUB
÷
2
4
or f
SUB
÷
2
3
or f
SUB
÷
2
6
or f
SUB
÷
2
5
Downloaded from
Elcodis.com
electronic components distributor