Running the demonstration
UM1011
30/49
Doc ID 18064 Rev 1
2.7.4
Wave Player submenu
The STM32F100ZET6 microcontroller features an embedded DAC which can be used to
generate output signals.
In this demonstration, any wave file stored under the USER folder in the MicroSD Card can
be opened using the file system DOSFS and transferred to the internal SRAM by block
(512 bytes) using the DMA and the SPI interface. Timer 6 (TIM6) triggers the DAC to
generate the wave signal. The voice sampling period is read from the Wave File Header. An
audio amplifier is connected to the DAC interface to play the stored wave files. This
application illustrates all STM32 DAC features and modes using dedicated examples and
lists the configuration steps for each mode.
Note:
The wave files available in the MicroSD Card are based on free music downloads from the
http://www.danosongs.com website.
This application reads all wave files from the USER directory (see
Section 4.1:
Programming the media files
) and displays only the .WAV files having the following format:
●
Audio format: PCM (an uncompressed wave data format in which each value
represents the amplitude of the signal at the time of sampling)
●
Sample rate: may be 8000, 11025, 22050 or 44100 Hz
●
Bits per sample: 8 bits (audio sample data values are in the range [0-255])
●
Number of channels: 1 (mono) or 2 (stereo)
The
Wave Player
submenu is shown in
Figure 33.
Figure 33.
Wave Player submenu
When you select Wave Player, the wave player interface is displayed as shown in
Figure 34.
Figure 34.
Wave Player interface
Wave Player
Return
Wave Player
STM32 DAC Audio Demo
Playing Wave files
SEL
: Play
DOWN
: Return
LEFT
: Next Wave
RIGHT
: Previous Wave
TAMPER
: Speaker
KEY
: Headphone
USER/ xxxxxxxx