Toshiba TLCS-900/L1 Series Manual page 218

Original cmos 16-bit microcontroller
Hide thumbs Also See for TLCS-900/L1 Series:
Table of Contents

Advertisement

3.14.3
Operational Description
(1) Melody generator
The melody function generates signals of any frequency (4 Hz to 5461 Hz) based on
low-speed clock (32.768 kHz) and outputs the signals from the MLDALM pin.
By connecting a loud speaker outside, melody tone can sound easily.
(Operation)
At first, MELALMC<MELALM> have to be set as 1 in order to select melody
waveform as output waveform from MLDALM. Then melody output frequency has to
be set to 12-bit register MELFH, MELFL.
Followings are setting example and calculation of melody output frequency.
(Formula for calculating of melody waveform frequency)
melody output waveform
setting value for melody
(notice: N = 1 to 4095(001H to FFFH), 0 is not acceptable)
(Example program)
In case of outputting La musical scale (440 Hz)
LD
LD
LD
(Refer to Basic musical scale setting table)
Scale
C
D
E
F
G
A
B
C
f
MLD
N = (16384/f
(MELALMC), ---XXXX1B
(MELFL), 23H
(MELFH), 80H
Frequency [Hz]
Register Value: N
264
297
330
352
396
440
495
528
91C824-216
at fs = 32.768 [kHz]
[Hz] = 32768/(2 × N + 4)
) – 2
MLD
; select melody waveform
; N= 16384/440 – 2 = 35.2 = 023H
; start to generate waveform
03CH
035H
030H
02DH
027H
023H
01FH
01DH
TMP91C824
2008-02-20

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tmp91c824fgJtmp91c824-s

Table of Contents