Using two I2Cs simultaneously - ESP32-S3

e-music
Posts: 15
Joined: Thu Jan 17, 2019 5:52 pm

Using two I2Cs simultaneously - ESP32-S3

Postby e-music » Sun Jun 18, 2023 3:57 pm

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.

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

Re: Using two I2Cs simultaneously - ESP32-S3

Postby ESP_Sprite » 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.

e-music
Posts: 15
Joined: Thu Jan 17, 2019 5:52 pm

Re: Using two I2Cs simultaneously - ESP32-S3

Postby e-music » Mon Jun 19, 2023 9:36 am

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?

e-music
Posts: 15
Joined: Thu Jan 17, 2019 5:52 pm

Re: Using two I2Cs simultaneously - ESP32-S3

Postby e-music » Mon Jun 19, 2023 9:40 am

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.

e-music
Posts: 15
Joined: Thu Jan 17, 2019 5:52 pm

Re: Using two I2Cs simultaneously - ESP32-S3

Postby e-music » Mon Jun 19, 2023 10:44 am

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

MicroController
Posts: 1700
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Using two I2Cs simultaneously - ESP32-S3

Postby MicroController » Mon Jun 19, 2023 1:25 pm

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

Who is online

Users browsing this forum: ajay.rathor and 99 guests