2017-09-03 02:44 PM
I have a custom board (2 layer) using a STM32F446RETx (3.3v) with STM32CubeMX, V4.22 with firmware V1.16.0. I am reading/processing MP3 files from a sdcard and there is a low-level but perceptible 'thump' in the audio when the card is read. I can change the noise interval by changing the size of the fatfs read buffer. Also see waveform, top trace is SDIO D0 and bottom trace is DAC1
processor speed is 120MHz
SDIO clk 48MHzSDCARD 4-bit with DMA and a lower priority than DACAllowing SDCARD reads but forcing DAC output to a set level (2047) the 'thump' is still heard when the card read takes place. (sounds rather like listening to a heartbeat in a stethoscope).Changing the DAC from 12 bit to 8 bit had no effect.
Enabling or disabling the DAC output buffer has no effect.Changing slew rate on the GPIO pins has no effect.Changing SDIOCLK divisor has no effect.Using 3 different sdcards has no effect.I re-did the board, moving the SDCARD slot away from the CPU and added a 33uF cap across SDCARD pwr supply.SDCARD slot is not under or in close proximity to the MCU and SD traces are not in parallel or close to the DAC traces.The sound quality of the DAC output is fine except for the noise when the card is read.
I thought this would not be a problem since the card and dac are on separate DMA controllers.
Should I give up on using the internal DACs and go with a I2S external DAC?
Thanks for any suggestions.
2017-09-06 03:53 AM
At least I now feel confident this is not a problem with concurrent DMA activity.
I never said that. It still may be both.
My point was that you should be aware of the mechanisms involved before you start a redesign blindly.
JW
2017-09-23 04:35 PM
For anyone who comes across this thread, the DAC/SDIO DMA was not the problem.
The DAC output goes to a opamp biased with a voltage divider. When the SD card was read, it caused enough of a drop in the power supply to pull the divider down slightly. By putting a capacitor across the voltage divider, the noise went away.