AnsweredAssumed Answered

STM32F407 DAC Output (12Bit) Droning

Question asked by Jakob Czekansky on Nov 8, 2017
Latest reply on Nov 9, 2017 by Jakob Czekansky

Hey guys,

 

I have some problem with the output of my DAC and I hope you have some idea, what went wrong...

 

Situation: 

   I am trying to play a WAV audio file with the DAC of my STM32F407VET. I use a double buffer, the DMA and I trigger    the DAC with a Timer which has the frequency of the ~SampleRate of the track. 

 

Used: 

   SDIO (µSD Card),

   FatFs,

   DAC with output buffer (CubeMX),

   Timer to trigger DAC,

   DMA (double buffer to DAC),

   DMA Callback Functions for "Half/Full Transfer Completed" to notify the free buffer part

 

Problem: 

   I can play the WAV file and the quality of the 12Bit output is "ok", but there is always a droning in the sound - some    audible frequency which shouldn't be there. As I found out I can change the frequency of the droning by changing the    size of my buffer. Smaller buffer => higher frequency...

 

I attach the schematic of my board and some of the code. I really hope you experts can find my bug... 

 

Greets

 

Ps.: I had to change the HAL_DAC_Start_DMA for double buffering. 

Outcomes