STMicroelectronics AN4058 STM32F0xx DAC Audio and Waveform Generation Application Note

AN4058 describes the main features of the STM32 DAC module and provides two examples of using the DAC to generate single-channel audio and WAV audio.


STMicroelectronics AN4058 STM32F0xx DAC Audio and Waveform Generation Application Note - cover page
Brand
STMicroelectronics
Category
microcontrollers
Document type
Application Note
Language
English
Pages
18
File format
PDF
File size
486 KB
Published
07 August, 2012
Updated
30 September, 2023
MD5 checksum
73AFC1E540ABF7249140F24F2E3724D7

About this manual

The document provides an overview of the STM32 DAC module, describing its 12-bit data format, support for dedicated timers, DMA capabilities, underrun error handling, and buffered output options. It details how to configure these features for driving external loads without operational amplifiers.

Two practical application examples are presented: generating a sine waveform by preparing digital patterns and fixing the frequency via timer configuration, and implementing an audio wave player that reads .WAV files from memory (such as MicroSD Flash) to drive external speakers.

What's inside

  • DAC main features
  • Data format
  • Dedicated timers
  • DMA capabilities
  • DMA underrun error
  • Buffered output
  • Sine waveform generation example
  • Audio wave player implementation

Specifications

DAC resolution12-bit word converter
Output channelsOne output channel for mono audio
Data formats supported8-bit, 12-bit right aligned, 12-bit left aligned
DMA channel connectionConnected to DMA channel 3

Frequently asked questions

What are the supported data formats for the STM32 DAC?

The DAC accepts data in three integer formats: 8-bit, 12-bit right aligned, and 12-bit left aligned.

Can the STM32 DAC drive external loads without an operational amplifier?

Yes, by enabling the embedded output buffer on the DAC channel.

What is the primary use of the STM32 DAC module?

It is primarily used for generating audio output signals such as security alarms, Bluetooth headsets, and low-cost music players.

Download PDF (486 KB)

More STMicroelectronics Manuals


View all STMicroelectronics manuals →