Page 1 of 1

Using two I2Cs simultaneously - ESP32-S3

Posted: Sun Jun 18, 2023 3:57 pm
by e-music
According to specs and many pinout charts for ESP32-S3 modules/DevKits, these modules offer two I2C peripherals, but I couldn't find any reference to the second I2C on any of these modules. Even on the KORVO board, the same I2C seems to be used across all peripherals available on the board (codec, CTP). I read the datasheet, but it didn't help much. Even if the second I2C is muxed with some GPIOs, it's really vague how/where it's assigned. Again, I'm not targeting two different devices on the same I2C bus with two unique I2C addresses. I want to use two separate I2Cs simultaneously.

Re: Using two I2Cs simultaneously - ESP32-S3

Posted: Mon Jun 19, 2023 2:15 am
by ESP_Sprite
If you're referring to the fact that you don't see specific i2c pins; like a lot of ESP peripherals, you can route the i2c signals of any of the two i2c peripherals to any pin; in ESP-IDF, the I2C driver initialization will allow you to specify which ones you want to use. The ESP-IDF driver has support for both I2C peripherals; simply initialize the 2nd one in the same way as the 1st but pass I2C_NUM_1 as the port.

Re: Using two I2Cs simultaneously - ESP32-S3

Posted: Mon Jun 19, 2023 9:36 am
by e-music
Yes exactly, that's what I was referring to. So, basically these are available as GPIO-mapped pins through the ESP-IDF? What about the Arduino Platform?

Re: Using two I2Cs simultaneously - ESP32-S3

Posted: Mon Jun 19, 2023 9:40 am
by e-music
By the way, why everyone out there is referring to the entire ESP32 family as a "dual-core" while only a few variants, like the ESP32-S3, ship with dual-core units? For example, I was under the impression that all the ESP32-WROVER-B modules feature a dual-core chip, but I just realized that most of these, if not all of them, are single-core CPUs.

Re: Using two I2Cs simultaneously - ESP32-S3

Posted: Mon Jun 19, 2023 10:44 am
by e-music
ESP_Sprite wrote:
Mon Jun 19, 2023 2:15 am
If you're referring to the fact that you don't see specific i2c pins; like a lot of ESP peripherals, you can route the i2c signals of any of the two i2c peripherals to any pin; in ESP-IDF, the I2C driver initialization will allow you to specify which ones you want to use. The ESP-IDF driver has support for both I2C peripherals; simply initialize the 2nd one in the same way as the 1st but pass I2C_NUM_1 as the port.
Any pin or just the following?

I2C0:
SDA (Data): GPIO 21
SCL (Clock): GPIO 22

I2C1:
SDA (Data): GPIO 16
SCL (Clock): GPIO 17

Re: Using two I2Cs simultaneously - ESP32-S3

Posted: Mon Jun 19, 2023 1:25 pm
by MicroController
e-music wrote:
Mon Jun 19, 2023 10:44 am
Any pin or just the following?
Any* pin.


* with a few exceptions, see e.g. viewtopic.php?f=2&t=34077#p115256