Author Topic: STM32, I2S, and setup in CubeIDE (or, how the hell does I2S_CKIN work)  (Read 766 times)

0 Members and 1 Guest are viewing this topic.

Offline Mr GreenTopic starter

  • Newbie
  • Posts: 1
  • Country: au
Hi,

Currently putting together a project using an STM32 processor connected to a codec, simple stereo in stereo out. Details on how to properly setup the I2S interconnects however, have eluded me. Surprisingly, every tutorial just tells you the basics and then unceremoniously ends, leaving me a bit confused when it comes to the finer details. On that note if there is some document explaining every peripheral option and their settings in CubeIDE I'd love to see it!

Getting to the point, I'm using two independent I2S lines (one out, one in) at 48KHz to connect to an ADAU1701 codec. The codec will have its own 12.288 MHZ oscillator and so will be the master for both lines. My question is then: if the STM32 is only an I2S slave, does the master clock input I2S_CKIN matter at all? Is there any situation where this would have an effect? My intuition tells me no, but the "real audio frequency" in the I2S setting panel is still displayed and updated when you change the clock source, even in slave mode.

I would assume that since the STM32 is not generating any clocks for the I2S itself, then having a master clock connected wouldn't change anything. The STM32 and codec will also be the only I2S devices, so it's not like there needs to be synchronisation over multiple ICs. Of course as with any audio topic my searches just led to some vague mentions of clock jitter and zero documentation...

As a bonus question, how does the "master clock out" setting work when you have I2S_CKIN enabled as the source? If you set 12.288 MHz as the input and enable 48KHz I2S it has no problems and 0% error, but if you enable the master clock output CubeIDE tells you that 12.288MHz is now far too low and you need 43.008MHz+ (3.5x) instead. What exactly is happening here? I assumed the master clock output would be 256 x fs, but it's asking for 896 x fs? Is it dividing it before output? This isn't relevant for my current project but if my next one involves the STM32 being master for I2S then I'm clueless.

Thanks in advance.
« Last Edit: January 03, 2023, 12:47:24 pm by Mr Green »
 

Offline danieljfarrell

  • Contributor
  • Posts: 19
  • Country: gb
Bump. This is a well posed question. I have exactly the same question regarding how things should be configured in CubeIDE.
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5973
  • Country: es
Have you RTFM or just asking?
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf