sh6616 SinoWealth Micro-Electronics Corp. Ltd, sh6616 Datasheet - Page 11

no-image

sh6616

Manufacturer Part Number
sh6616
Description
16k 4-bit Microcontroller
Manufacturer
SinoWealth Micro-Electronics Corp. Ltd
Datasheet
Application Example:
A user uses 2MHz RC clock (RC OSC), and he wants to create a tone ‘C3’ whose frequency is 130.81Hz.
If the user writes 00H to P.1 and P.0, then the PSG-CLK is 2M/64 = 32KHz, the value of N is 32K/2/130.81 = 122.3, look up 122 in
the table, the corresponding initial data of LSFR is 20H.
If the user writes 01H to P.1 and P.0, then the PSG-CLK is 2M/128 = 16KHz, the value of N is 16K/2/130.81 = 61.2, the initial data
is 49H
If the user writes 10H to P.1 and P.0, then the PSG-CLK is 2M/256 = 8KHz, the value of N is 8K/2/130.81 = 31, the initial data is
4BH.
If the user writes 11H to P.1 and P.0, then the PSG-CLK is 2M/512 = 4KHz, the value of N is 4K/2/130.81 = 16, the initial data is
4AH.
When the tone frequency is too low, the wanted value of N maybe greater than 127, the counter cannot create this value, the best
solution is to select low PSG-CLK. For example, the frequency of tone ‘C1’ is 32.7Hz, if the PSG-CLK is greater than 8KHz, the
wanted N is greater than 127, but the 4khz PSG-CLK can create this tone.
According to this illustration, the user can make music tables. If the user selects RC OSC as 2MHz, the music table is provided as
following.
Music Table 1:
Following is the music scale reference table for Channel 1 (or Channel 2) under Actual Clock = 32KHz.
Note
G3#
C3#
D3#
A3#
C4#
D4#
F3#
F4#
C3
D3
G3
A3
B3
C4
D4
E3
F3
E4
F4
130.81
138.59
146.83
155.56
164.81
174.61
185.00
195.99
207.65
220.00
233.08
246.94
261.62
277.18
293.66
311.13
329.62
349.22
369.99
Ideal
freq.
122
115
109
103
97
92
86
82
77
73
69
65
61
58
54
51
49
46
43
N
(C2.14 ~ C2.8)
(C1.6 ~ C1.0)
LSFR
6A
7A
1C
4D
5A
5B
5E
20
61
51
19
45
33
27
21
44
49
56
76
131.15
139.13
146.79
155.34
164.95
173.91
186.05
195.12
207.79
219.18
231.88
246.15
262.30
275.86
296.30
313.73
326.53
347.83
372.09
freq.
Real
Error %
-0.03%
-0.14%
-0.40%
-0.44%
-0.37%
-0.51%
-0.32%
-0.48%
-0.94%
-0.40%
0.26%
0.39%
0.08%
0.57%
0.07%
0.26%
0.90%
0.84%
0.57%
11
Note
G4#
A4#
C5#
D5#
G5#
A5#
C6#
F5#
G4
B4
C5
D5
G5
B5
C6
A4
E5
F5
A5
1108.73 14
415.30
466.16
554.37
622.25
739.99
830.61
932.33
1046.5
392.0
440.0
493.9
523.2
587.3
659.2
698.4
784.0
880.0
987.7
Ideal
freq.
41
39
36
34
32
31
29
27
26
24
23
22
20
19
18
17
16
15
N
(C2.14 ~ C2.8)
(C1.6 ~ C1.0)
LSFR
5C
4C
1A
4B
2E
3B
4A
2A
58
63
69
25
77
39
73
19
32
65
15
1000.00 1.24%
1066.67 1.93%
1142.86 3.08%
390.24
410.26
444.44
470.59
500.00
516.13
551.72
592.59
615.38
666.67
695.65
727.27
800.00
842.11
888.89
941.18
Real
freq.
SH6616
Error %
-0.44%
-1.21%
-1.36%
-0.48%
-1.10%
-0.40%
-1.72%
1.01%
0.95%
1.24%
0.90%
1.13%
2.04%
1.38%
1.01%
0.95%

Related parts for sh6616