STM32L4 Using DAC to play audio/voice files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-12-11 3:50 AM
Hi,
Has anyone tried or managed to have success in playing audios or voices data using the on board DAC on STM32L452? with a speaker connecting just to the DAC.
I am at a proof of concept stage, where I am using an ST PDM microphone connected to an Nucleo L452RE board. Using DFSDM to get the PCM data and then output it to the DAC, however I am only able to hear hisses.
I have managed to generate sinewave at different frequency using different size look up table and varying TIM6 tigger.
Many Thanks!
- Labels:
-
Audio
-
DAC
-
STM32L4 series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-12-11 4:43 AM
Check out the datasheet of the L452.
The common implementation of the DAC (coming with other STM32 family members) has an output impedance of 1MOhm without buffer, or 15kOhm with enabled output buffer. Far from sufficient for speakers/headphones. And enabling the buffer uses to add up to 200mV offset to the DAC output.
I think you will need an external amplifier.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-12-11 9:27 AM
Thanks for your reply. Unfortunately we do not have enough space to put in an external DAC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-12-11 8:00 PM
Have you considered using the built-in op amp? It has a PGA mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-12-11 10:17 PM
No external DAC, but an amplifier. Like an opamp.
As Rob.Riggs suggested, check if you can use the buit-in opamp.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-12-12 1:07 AM
"Has anyone tried or managed to have success in playing audios or voices data using the on board DAC on STM32L452? with a speaker connecting just to the DAC."
Yes. I use a double buffer fed from SDcard in the main loop and a timed interrupt feeding the DAC from the current buffer. Easiest file format is .WAV - no processing needed - use a sound file converter to create suitable mono wav file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-12-12 2:34 AM
Hi All,
Thanks for all the suggestions, I will have at them!
Sam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-04-25 4:40 AM
Hi All,
Am facing same issues after using op amp. I am only able to hear hisses.
I have done the setup like i have connected STM32L452RE DAC output to TPA0211 and from TPA0211 to speaker.
I have configured the dma configuration and Tim6 to trigger, and am using the HAL dma api to transmit the whole data at one time(like 20000 bytes).
Am i missing any configuration or am i doing in any wrong method please let me know.
Many Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-04-25 5:47 AM
> I have done the setup like i have connected STM32L452RE DAC output to TPA0211 and from TPA0211 to speaker.
Have you checked the input impedance of the TPA0211, does it match the output impedance of the DAC ?
In normal, unbuffered configuration, the DAC has about 1 MOhm.
Have you checked the signals with a scope ?
