Pins for I2C and SPI communication on ESP32-S3-DevKitC-1

Yohani
Posts: 6
Joined: Tue Jan 09, 2024 7:12 pm
Location: Valdivia, Chile

Pins for I2C and SPI communication on ESP32-S3-DevKitC-1

Postby Yohani » Wed Jan 10, 2024 6:23 pm

First post I've made in my life, I hope it can help me.

I am working with the esp32-S3 board, I need to use SPI and I2C communication, but I cannot find the pins related to these.

I understand that in GPIO35-36-37 there is SPI communication (of the two available), but it does not explain the MOSI, MISO and CLK pin.
On the other hand, I do not identify the SDA and SCL pins anywhere.

I hope you can help me, thank you very much!

Image

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: Pins for I2C and SPI communication on ESP32-S3-DevKitC-1

Postby ESP_Sprite » Thu Jan 11, 2024 2:02 am

Congrats on your first post!

Most digital peripherals on the ESP32 series are generally connected to IO pins via two systems: the IOMUX and the GPIO matrix. The IOMUX offers a tiny bit less latency, but only allows connecting to specific IO pins; the GPIO matrix has some extra latency but allows any signal of a digital peripheral to be connected to any GPIO pin.

The SPI peripheral can be connected via both the IOMUX and the GPIO matrix. The pins indicated are for the IOMUX, but for 99% of the use cases you can actually use any (not otherwise used) GPIO for this using the GPIO matrix.

Because I2C is generally quite slow, it doesn't have an IOMUX connection, and does not have 'standard' pins for it. Still, the GPIO matrix allows you to use any pin for any I2C signal.

Hope that clarifies it a bit.

Yohani
Posts: 6
Joined: Tue Jan 09, 2024 7:12 pm
Location: Valdivia, Chile

Re: Pins for I2C and SPI communication on ESP32-S3-DevKitC-1

Postby Yohani » Thu Jan 11, 2024 2:11 pm

Thank you very much for your answer.

I'm a little new to this and would like to go deeper, but from what I understand you're telling me that by using the GPIO matrix, can I assign functions to any pin?
If so, how would the programming be, for example, if I want a pin to be MOSI, how would I do it?

I also take the opportunity to ask: Is it possible and how can I use VSPI?

Thank you so much!!!!! :D

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: Pins for I2C and SPI communication on ESP32-S3-DevKitC-1

Postby ESP_Sprite » Fri Jan 12, 2024 3:03 am

Yohani wrote:
Thu Jan 11, 2024 2:11 pm
I'm a little new to this and would like to go deeper, but from what I understand you're telling me that by using the GPIO matrix, can I assign functions to any pin?
If so, how would the programming be, for example, if I want a pin to be MOSI, how would I do it?
For most peripherals, yes. How to do this depends on your SDK: for instance, with ESP-IDF, you'd pass the GPIO pins to the function that initializes the SPI bus.
I also take the opportunity to ask: Is it possible and how can I use VSPI?
Yes, you can, using the same programming interface.

Who is online

Users browsing this forum: Bing [Bot] and 54 guests