I have both an SD card and a MAX98357A (I2S Amplifier) breakout board connected to my STM32 Nucleo. As soon as I open a file for reading in FatFs using the f_open
command, the speaker attached to the MAX98357A starts making a horribly loud pitch static noise and visibly vibrates.
I'm pretty confident that this is due to the 16 MHz clock line that I have running to the SDIO. If I remove any of the SDIO/FatFs functions, then I no longer get that noise, just some occasional clicks. This is all without even initializing any of the I2S peripherals. The breakout board is just connected to power and ground.
Unfortunately, I'm still stuck with breadboarding this for now. Are they any strategies that I could use to remove that noise?
Things I've tried:
- 680 μF and 470 nF capacitor on power and ground rails
- Connecting the MAX98357A to a separate ground PIN
- Using a 5 V regulator for the MAX98357A
Putting my hand on my laptop near the USB port seems to also alleviate the buzzing noise.
Photo for reference: