TMP92CF30
2009-06-12
92CF30-514
3.21.3 Operational Description
3.21.3.1
Melody generator
The Melody function generates signals of any frequency (4Hz-5461Hz) based on a
low-speed clock (32.768kHz) and outputs the signals from the MLDALM pin.
The melody tone can easily be heard by connecting an external loud speaker.
(Operation)
MELALMC<MELALM> must first be set as 1 in order to select the melody waveform
to be output from MLDALM. The melody output frequency must then be set to 12-bit
register MELFH, MELFL.
The following are examples of settings and calculations of melody output frequency.
(Formula for calculating melody waveform frequency)
@fs
=
32.768 [kHz]
Melody output waveform
f
MLD
[Hz]
=
32768/ (2
×
N
+
4)
Setting value for melody
N
=
(16384/ f
MLD
)
−
2
(Note: N
=
1~4095 (001H~FFFH), 0 is not acceptable)
(Example program)
When outputting an “A” musical note (440Hz)
LD
(MELALMC),
−−
XXXXX1B ;
Select
melody
waveform
LD
(MELFL),
23H
;
N
=
16384/440
−
2
=
35.2
=
023H
LD
(MELFH), 80H
;
Start to generate waveform
(Refer: Basic musical scale setting table)
Scale Frequency
[Hz]
Register
Value: N
C 264
03CH
D 297
035H
E 330
030H
F 352 02DH
G 396
027H
A 440
023H
B 495
01FH
C 528
01DH
Содержание TLCS-900/H1 Series
Страница 1: ...TOSHIBA Original CMOS 32 Bit Microcontroller TLCS 900 H1 Series TMP92CF30FG Semiconductor Company ...
Страница 650: ...TMP92CF30 2009 06 12 92CF30 648 7 Package Dimensions LQFP176 P 2020 0 40F TOP VIEW BOTTOM VIEW Detail view of A 25 1 A ...
Страница 652: ...TMP92CF30 2009 06 12 92CF30 650 ...