cancel
Showing results for 
Search instead for 
Did you mean: 

[STM32F411RE] I2S - Keep MCLK (WS) and SCK clocks running.

Carlos Diaz R.
Associate III

Hi,

I'm using the STM32F411RE device to decode MP3 audio files, i'm sending the decoded data to a MAX98357A amplifier via I2S and DMA, when the SCK signal is removed from the amplifier there's a DC offset at it's output which is causing a distorted audio output and a current peak, to avoid it i have two options:

  • Keep SCK and WS running, (keep only WS running if possible).
  • Disable the amplifier via I2S_SHTDWN before removing SCK and WS.

Is it possible to configure the I2S peripheral to keep SCK and WS running even when i'm not sending data? If it's not possible i can try to send 0's until i got decoded data so both SCK and WS keep running but i would prefer to avoid it.

Any ideas?

Image showing both SCK and WS stopping when there's no more data to send, this capture shows sending a whole audio slip to the amplifier.

0690X0000089c6gQAA.png

Similar issue, not solved here.

2 REPLIES 2

The standard way to handle I2S is to use circular DMA to feed it continuously. It's the responsibility of the application to fill the circular source buffer for the DMA with enough data, i.e. also with zeros if there are no data.

JW

Thanks for the reply JW, i did tried keeping the I2S sending data continuously (zeroes when i need to mute the amp) and i think i got it working, tomorrow i will be able to test it with the amplifiers, today i just saw the signals with the logic analyzer.

So far I was working with two arrays and a pointer that keep track of the current array being sent to the amplifier, i guess this can be improved by using a single array and the DMA in circular mode, i will try that later this week.

Regards,

Carlos