Share I2S clock&WS between both i2s interfaces

michikite
Posts: 16
Joined: Thu Oct 22, 2020 1:35 am

Share I2S clock&WS between both i2s interfaces

Postby michikite » Thu May 20, 2021 12:39 am

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)

ns1668
Posts: 50
Joined: Tue Mar 16, 2021 2:00 pm

Re: Share I2S clock&WS between both i2s interfaces

Postby ns1668 » Fri May 21, 2021 9:29 am

- 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.

michikite
Posts: 16
Joined: Thu Oct 22, 2020 1:35 am

Re: Share I2S clock&WS between both i2s interfaces

Postby michikite » Fri May 21, 2021 9:52 pm

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

ns1668
Posts: 50
Joined: Tue Mar 16, 2021 2:00 pm

Re: Share I2S clock&WS between both i2s interfaces

Postby ns1668 » Mon May 24, 2021 7:24 am

Good stuff, glad to hear its working.

Who is online

Users browsing this forum: No registered users and 215 guests