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.
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.
| DAC resolution | 12-bit word converter |
|---|---|
| Output channels | One output channel for mono audio |
| Data formats supported | 8-bit, 12-bit right aligned, 12-bit left aligned |
| DMA channel connection | Connected to DMA channel 3 |
The DAC accepts data in three integer formats: 8-bit, 12-bit right aligned, and 12-bit left aligned.
Yes, by enabling the embedded output buffer on the DAC channel.
It is primarily used for generating audio output signals such as security alarms, Bluetooth headsets, and low-cost music players.