2018-12-11 03: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!
2018-12-11 04: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.
2018-12-11 09:27 AM
Thanks for your reply. Unfortunately we do not have enough space to put in an external DAC
2018-12-11 08:00 PM
Have you considered using the built-in op amp? It has a PGA mode.
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.
2018-12-12 01: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
2018-12-12 02:34 AM
Hi All,
Thanks for all the suggestions, I will have at them!
Sam
2019-04-25 04: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,
2019-04-25 05: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 ?