0
\$\begingroup\$

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:

enter image description here

\$\endgroup\$
10
  • \$\begingroup\$ The SD card works with 16MHz clock and these wires? No data errors? \$\endgroup\$
    – bobflux
    Commented Jan 22 at 23:48
  • \$\begingroup\$ Yep. I can open a file and read it just fine. \$\endgroup\$
    – Movieboy
    Commented Jan 22 at 23:54
  • 2
    \$\begingroup\$ I wouldn't trust it, these wires are asking for trouble... anyway, you can try putting the decoupling capacitor as close as possible to the class D module. Also investigate if noise couples into the shutdown pin of the amp, which would turn it on/off quickly and make some sounds. Maybe you can put a pullup/pulldown on that pin, see if that fixes it. \$\endgroup\$
    – bobflux
    Commented Jan 22 at 23:58
  • \$\begingroup\$ You said that this happens without setting up I2S... what happens if you do setup I2S? ... and what happens if you don't setup I2S, but set the relevant STM32 pins to output and an idle state? \$\endgroup\$
    – Attie
    Commented Jan 23 at 1:04
  • \$\begingroup\$ Still happens in either situation. I noticed though, that it's only the LRC, BLCK, and DATA Pins which causes the noise. Leaving those pins unplugged and just the power and ground connected, no noise. As soon as I connect one of those pins, noise starts. But the noise starts the moment that my SDIO clock turns on in the code. Before I get to that point in the debugger, everything is quiet. \$\endgroup\$
    – Movieboy
    Commented Jan 23 at 2:30

1 Answer 1

1
\$\begingroup\$

Figured it out. My GPIO Slew rate was too high. It was introducing too much EMI. Lowering it fixed the problem.

\$\endgroup\$
1
  • \$\begingroup\$ Don't forget to accept your own answer (I think the site will allow you within two days) so the question does not remain open. \$\endgroup\$ Commented Jan 25 at 16:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.