English
Language : 

AN3126 Datasheet, PDF (1/24 Pages) STMicroelectronics – Audio and waveform generation using the DAC in STM32 microcontrollers
AN3126
Application note
Audio and waveform generation using the DAC in
STM32 microcontrollers
Introduction
This application note provides some examples for generating audio waveforms using the
Digital to Analog Converter (DAC) peripheral embedded in the microcontrollers of the
STM32Fx and STM32Lx series.
This document applies to products listed in Table 1, and should be read in connection with
application note AN4566 “Extending the DAC performance of STM32 microcontrollers”.
A digital to analog converter, DAC, is a device that has the opposite function to that of an
analog to digital converter, i.e. it converts a digital word to a corresponding analog voltage.
The STM32 DAC module is a 12-bit word converter, with up to three output channels to
support audio functions.
The DAC can be used in many audio applications such as security alarms, Bluetooth
headsets, talking toys, answering machines, man-machine interfaces, and low-cost music
players
STM32 DAC can also be used for many other analog purposes, such as analog waveform
generation and control engineering.
The application note is organized in two main sections:
• Section 1 describes the main features of the STM32 DAC module.
• Section 2 presents two examples.
– In the first example, the DAC is used to generate a sine wavefom.
– In the second example, the DAC is used to generate audio from .WAV files.
Table 1. Applicable products
Type
Product series
STM32F0
Microcontrollers
STM32F1
STM32F2
STM32F3
STM32F4
STM32F7
STM32L0
STM32L1
STM32L4
April 2015
Doc ID16895 Rev 2
1/24
www.st.com
1