cancel
Showing results for 
Search instead for 
Did you mean: 

I2S passthrough - but STM32 only has one I2S data pin ?

freeflyer
Senior II

I am developing I2S on the NUCLEO-L433RC-P development board using a BT401 bluetooth audio receiver and MAX98357A I2S amplifier.

I need to pass the I2S audio data through the STM32L4333 (refer to diagram below). 

I have done this before using a Microchip dsPIC33E but this has both DATA IN and DATA OUT pins for I2S.

Whereas the STM32 only has a single DATA pin (SD), so it can only be DATA IN or DATA OUT.

Does this mean I cannot use the STM32 to pass through I2S data ?

freeflyer_0-1764239514938.png

 

1 REPLY 1
freeflyer
Senior II

Merged threads.

I am using an STM32L433 to pass I2S audio from a bluetooth receiver (BT401) to a PCM amplifier (MAX98357A) using DMA.

I have got it working, but there is an issue with the clock.  It plays the audio fine for a few seconds and then there is some interference for a few seconds and this repeats.

I have concluded that its due to the two seperate clocks i.e. the clock in the bluetooth receiver and the clock in the STM32.

The bluetooth receiver is configured to play 48kHz audio but the STM32 is configured to play 49.107kHz.

Even when I configured the STM32 to play 48kHz, the same issue occured but for different durations (assume due to discrepancies between the seperate clocks).

Below is my current architecture...

freeflyer_1-1764537408241.png

I am thinking that the bluetooth receiver and the STM32 need to use a common clock, so need to either change the architecture and/or configuration, but I am not sure what setup I need to achieve this.

The bluetooth receiver can be configured as:

  • I2S master
  • I2S slave
  • It also has a master clock output (12.288MHz for 48khz audio). 

The STM32 SAI blocks can be configure as:

  • Master
  • Master with master clock out
  • Asynchronous slave
  • Synchronous slave

Note that the PCM amp does not require a master clock.