cancel
Showing results for 
Search instead for 
Did you mean: 

Audio Codec & STM32

Jakeway141
Associate

This is my first time asking something in ST's Forum. I am trying to build class-D amplifier with STA309A codec from ST. I am using STM32 MCU as a Master Transmitter for audio. The codec has 8 input channels for serial audio data, LRCLK, MCLK & BCLK. As of my knowledge, I2S can only transmit in stereo mode. How do I play more than 2 channels for STA309A's Inputs. Apologies for my bad English.

1 ACCEPTED SOLUTION

Accepted Solutions
AScha.3
Chief II

STA309A input :

AScha3_0-1705859982571.png

So if you want to use 4 channels, send 1+2 with I2S as master , 3+4 as slave transmitter (sync to wck + bck ).

You need to have a I2S standard "stereo" output for every pair of channels, so check, the cpu you want to use, has as many as you need.

On newer cpus there is a SAI , that can also send I2S standard (and is more flexible than "old" I2S );

ex: stm32H563 has 3 x I2S ; and 2x SAI , each of this can have 2x I2S out, so max. 7 x (2ch) I2S possible;

or the 2 SAI can drive 4 x I2S , all the STA309 can receive.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

3 REPLIES 3
AScha.3
Chief II

STA309A input :

AScha3_0-1705859982571.png

So if you want to use 4 channels, send 1+2 with I2S as master , 3+4 as slave transmitter (sync to wck + bck ).

You need to have a I2S standard "stereo" output for every pair of channels, so check, the cpu you want to use, has as many as you need.

On newer cpus there is a SAI , that can also send I2S standard (and is more flexible than "old" I2S );

ex: stm32H563 has 3 x I2S ; and 2x SAI , each of this can have 2x I2S out, so max. 7 x (2ch) I2S possible;

or the 2 SAI can drive 4 x I2S , all the STA309 can receive.

If you feel a post has answered your question, please click "Accept as Solution".
Jakeway141
Associate

There is no option to synchronize wck and bck in CubeMX, do i have to connect them externally between I2S1 MASTER and I2S2 SLAVE Transmitters????

fdbe2d1d-f94c-46c9-9699-c976de95c368.jpg

Screenshot 2024-01-22 120429.jpg

Right, if there is no internal connection to select, you have to connect wck and bck externally .

If you feel a post has answered your question, please click "Accept as Solution".