2024-04-30 08:50 AM
Hello,
Please excuse the basic question, I am reading the datasheet of stm32f429ve trying to understand which pins I need to send data from the microcontroller to an audio codec using I2S.
I understand the I2S interface requires three pins, with an optional fourth pin:
However, I do not understand the function PB14 = I2S2_ext_SD.
Is this dependent on whether the pin is transmitting or receiving like MOSI or MISO in SPI? I cannot find this documented anywhere which makes me think it must be obvious :)
Solved! Go to Solution.
2024-04-30 09:03 AM
Hi,
read rm ...
So for full duplex I2S you need two data lines : in and out.
Just set it in Cube and you see... or rtfm. :)
2024-04-30 09:03 AM - edited 2024-04-30 09:04 AM
> I need to send data from the microcontroller to an audio codec using I2S.
Codec means "a combination of ADC and DAC", thus requires data in both directions, i.e. fullduplex ("both MOSI and MISO" in your SPI analogy).
If you need only to *send* from microcontroller, it's then not a *codec* but a DAC. In that case, you need only one data line.
The SPI/I2S module in STM32 is only simplex when it operates in I2S mode, i.e. it has only one data line. To support full-duplex I2S, for some SPI/I2S modules 'F429 (and a few other STM32) incorporate a second, simplified SPI/I2S module called I2Sext, which has only I2S mode (no SPI mode) and its clocks (WS and CK) are internally interconnected to its "partner" SPI/I2S module.
So, if you need fullduplex I2S, you'll need both I2S2_SD and I2S2_ext_SD (and you'll need to set up both SPI2/I2S2 and I2S2ext). If you need only simplex I2S, you don't need I2S2_ext_SD.
JW
2024-04-30 09:03 AM
Hi,
read rm ...
So for full duplex I2S you need two data lines : in and out.
Just set it in Cube and you see... or rtfm. :)
2024-04-30 09:46 AM - edited 2024-04-30 01:33 PM
Thanks for the really helpful advice everyone, that is totally clear. I was searching the PDF and didn’t find that diagram, will be less lazy next time :) because it is not in the data sheet. Instead it is in the Reference Manual RM0090 and appears to be slightly different.