Page 1 of 1

Share I2S clock&WS between both i2s interfaces

Posted: Thu May 20, 2021 12:39 am
by michikite
I set up a TX i2s interface on my esp32 and can see the master clock and left-right clock fine on my osciloscope.
I also set up a a second i2s RX interface with its own clock.

Now I was wondering about two things:

- Can I re-use the TX clock pins to drive both i2s interfaces ?
- Can I read those clock pins like normal GPIO pins? (This has no specific use, just wondering because I tried and I always read 0)

Re: Share I2S clock&WS between both i2s interfaces

Posted: Fri May 21, 2021 9:29 am
by ns1668
- Can I re-use the TX clock pins to drive both i2s interfaces ?
I have managed to run a loopback from I2S0 TX to I2S1 RX - so yes you can drive the RX clock from TX output.

- Can I read those clock pins like normal GPIO pins? (This has no specific use, just wondering because I tried and I always read 0)
Unsure, maybe the state is in a peripheral register somewhere, take a look at the technical reference manual.

Re: Share I2S clock&WS between both i2s interfaces

Posted: Fri May 21, 2021 9:52 pm
by michikite
Thanks for the tip!
I got it to work.
The i2s driver sets the clock pin to OUTPUT.
changed it to input and output and mapped it to the second interface using the gpio matrix

Re: Share I2S clock&WS between both i2s interfaces

Posted: Mon May 24, 2021 7:24 am
by ns1668
Good stuff, glad to hear its working.