2024-01-21 09:51 AM
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.
Solved! Go to Solution.
2024-01-21 10:11 AM - edited 2024-01-21 10:14 AM
STA309A input :
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.
2024-01-21 10:11 AM - edited 2024-01-21 10:14 AM
STA309A input :
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.
2024-01-21 10:36 PM
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????
2024-01-21 11:32 PM
Right, if there is no internal connection to select, you have to connect wck and bck externally .