English
Language : 

GMS81C5108 Datasheet, PDF (63/102 Pages) Hynix Semiconductor – HYNIX SEMICONDUCTOR INC. 8-BIT SINGLE-CHIP MICROCONTROLLERS
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.
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
00H 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 0H and 3FH by software. Note that
BDR is a write-only register. Frequency calculation is fol-
lowing as shown below.
fBUZ(Hz) = 2-----×-----P---r--Oe---s-s-c-c--a-i-l-l-el--a-r--t-Ro----ra---Ft--i-ro--e---×q---u--(-e-B--n--C-c--y--D-----+-----1----)
The bits BCK1, BCK0 of BDR select the source clock
from prescaler output
fBUZ: BUZ pin frequency
Prescaler ratio: Prescaler divide ratio by BDR[7:6]
BCD value: 6-bit compare data, BCD[5:0].
BDR (Buzzer Data Register)
W
Bit : 7
BCK1
W
6
BCK0
W
5
BCD5
W
4
BCD4
W
3
BCD3
W
2
BCD2
W
1
BCD1
W
0
BCD0
BCK[1:0] (Buzzer Clock Source)
00: fMAIN÷23
01: fMAIN÷24
10: fMAIN÷25
11: fMAIN÷26
or fSUB÷23
or fSUB÷24
or fSUB÷25
or fSUB÷26
BCD[5:0] (Buzzer Control Data)
Buzzer Period Data
ADDRESS : 0FDH
RESET VALUE : 00H
Bit manipulation is not available.
PMR (Port Mode Register)
- PWMO - BUZ EC0 INT2 INT1 INT0
ADDRESS :0D9H
RESET VALUE : -0-00000B
SCMR[1:0]
2
XIN
0X
SXIN
1X
÷8
÷ 16
÷ 32
÷ 64
BUZ (Buzzer Output)
0: R04 Port (turn off buzzer)
1: BUZ port (turn on buzzer)
MUX
COUNTER (6-bit)
BCK[1:0]
F/F
COMPARATOR
BCD (6-bit)
BUZ
[PMR.4]
R04/BUZ PIN
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
60
JUNE 2001 Ver 1.0