Download Print this page

Toshiba TLCS-900/H1 Series Manual page 380

Original cmos 32-bit microcontroller
Hide thumbs Also See for TLCS-900/H1 Series:

Advertisement

3.15.3
Operational description
3.15.3.1 Melody Generator
The Melody function generates signals of any frequency (4 Hz to 5461 Hz) based on a
low-speed clock (32.768 kHz) 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 registers MELFH and MELFL.
The following are examples of settings and calculations of melody output
frequency.
(Formula for calculating melody waveform frequency)
Melody output waveform
Setting value for melody
(Note: N = 1 to 4095 (001H to FFFH), 0 is not acceptable.)
(Example program)
When outputting an "A" musical note (440 Hz)
Reference) Basic musical scale setting table
Scale Frequency [Hz]
(MELALMC), − − X X X X X 1 B
LD
LD
(MELFL), 23H
LD
(MELFH), 80H
C
264
D
297
E
330
F
352
G
396
A
440
B
495
C
528
92CH21-378
at fs = 32.768 [kHz]
[Hz] = 32768/(2 × N + 4)
f
MLD
N = (16384/ f
) − 2
MLD
; Select melody waveform
; N = 16384/440 − 2 = 35.2 = 023H
; Start to generate waveform
Register Value: N
03CH
035H
030H
02DH
027H
023H
01FH
01DH
TMP92CH21
2009-06-19

Advertisement

loading

This manual is also suitable for:

Tmp92ch21fgJtmp92ch21