sh6613 SinoWealth Micro-Electronics Corp. Ltd, sh6613 Datasheet - Page 13

no-image

sh6613

Manufacturer Part Number
sh6613
Description
4k 4-bit Microcontroller With Lcd Driver
Manufacturer
SinoWealth Micro-Electronics Corp. Ltd
Datasheet
8.2 Function description
PSG as sound generator
The programmable sound is one of the 4 working modes. The software designer can select up to 16 clock sources as PSG clk.
And then select the CH1 and CH2 frequency divided value that is controlled by the value of REG C1.6~C1.0 or C2.14~C2.8.In
the end we can select the 4 volume level controlled by VOL0, VOL1. The music tone can output both PSG and PSG . We also
can control the OCT1, OCT2 bit that shifts the music tone 3 octaves.
Example1: CH1EN=CH2EN=1
Example3: CH1EN=CH2EN=1
So PSG clk = 32kHz; Switch clk = 32kHz
No vol. control, the VOL level is set to 4 by hardware, so software should set VOL0=VOL1=1.
Note: For 32KHz operations, the volume control cannot be used, because the PWM multiplexing frequency is not high enough
to switch sound! If a user want to turn off the PSG completely, the software must disable both channels. User should not turn off
the PSG by zero wave from output. Both the CH1EN and CH2EN should be set to "0" for the low power operation mode.
Example 4
If software designer wants to create C2 (channel 1) mixed with F5 (channel 2) sound (the C2, F5 sound frequency please see
the Music table1 and Music table2), VOL level=3.He can select the suggestion as follows.
(1) He first selects CH1EN=CH2EN=1,C1M=C2M=0.
(2) He can select OSCX=1.8M and SEL0=SEL1=1, so the PSG CLK=112.5KHz.
(3) Then he can select OCT1=1 and the value of channel 1 LSFR (C1.6~C1.0)=23,so the N =108. Please see the Music table1.
(4) Then he can select OCT1=0 and the value of channel 1 LSFR (C1.6~C1.0)=4F,so the N =81. Please see the Music table1.
(5) Lastly, he should select the VOL1=1 and VOL0=0, so the VOL level=3.
Note:
So the channel 1 sound frequency=112.5Khz/8/(2×108)=64.10Hz ≒ the C2 sound frequency.
So the channel 1 sound frequency=112.5Khz/1/(2×81)=694.4Hz ≒ the F5 sound frequency .
OSCX=1.8M,SEL0=SEL1=1
So PSG clk =112kHz;Switch clk=28kHz
Vol. clk=112kHz
OSC=32k,SEL0=SEL1=0
13/33
Example2: CH1EN=0;CH2EN=1
OSCX=1.8M,SEL0=SEL1=1
So PSG clk =112kHz;Switch clk=28kHz;
Vol. clk=112kHz
SH6613/B/C
V1.2

Related parts for sh6613