EM73982
4-BIT MICROCONTROLLER
SOUND EFFECT
EM73962 has a built-in sound generator. It includes the tone generator, random generator and volume control.
The tone generator is a binary down counter and the random generator is a 9-bit linear feedback shift register.
When the CPU is reseted or sleeping, the sound generator is disabled and the output (P4.0/SOUND) is high.
P.30
P23,P24
fb
3 kinds f1 Tone
÷2
of divider generator
f2x2
Random
generator
÷2
Output
Low control
PWM
SOUND
P17 volume control
Sound generator command register
There are 3 kinds of basic frequency for sound generator which can be selected by P30. The output of sound
effect is tone and random combination.
Port30 3 2 1 0
BFREQ SMODE
Initial value : 0000
BFREQ Basic frequency (f1) select
0 0 240 KHz
0 1 120 KHz
1 0 60 KHz
1 1 don't care
SMODE
00
01
10
11
Sound generator mode
Disable
Tone output
Random output
Tone+random output
Tone frequency register
The 8-bit tone frequency register is P24 and P23. The tone frequency will be changed when user output the
different data to P23. Thus, the data must be output to P24 before P23 when user want to change the 8-bit
tone frequency (TF).
Port24
Port23
32 1
0
32 1 0
Initial value : 1111 1111
Higher nibble register
Lower nibble register
** f1=240K/2X, f2=f1/(TF+1)/2, TF=1~255, TF-0
** Example : BFREQ=10, TF=00110001B.
⇒ f1=60K Hz, f2=60K Hz/50/2=600 Hz
Random generator
f(x)=x9+x4+1
+
12 3 4 5 6 7 8 9
* This specification are subject to be changed without notice.
11.30.2001 23