ESP32-S3 multiple I2C performance

TeQKez
Posts: 1
Joined: Sat Oct 14, 2023 8:55 pm

ESP32-S3 multiple I2C performance

Postby TeQKez » Sat Oct 14, 2023 9:25 pm

I want to connect 4 ADCs (ADS1015/1115) to an ESP32-S3 for a total of 16 inputs.

The data sheet for the ADCs suggest up to 4 can be connected on I2C line by addressing them appropriately.

But I've noticed that the ESP32-S3 can support 2 I2C controllers/ports.

If I want to sample these ADCs as fast as possible, would it be advantageous to split them up and put 2 ADS on each port?

Thanks.

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

Re: ESP32-S3 multiple I2C performance

Postby MicroController » Sun Oct 15, 2023 12:06 pm

It might when using 100kHz I2C. At 400kHz the potential gains would be diminishing though. If you schedule the I2C transactions right that is.

IIRC, for every sample we need
1+9+9+9+9+1 = 38 I2C clocks (one 16-bit register write) to select the channel and start the conversion, plus 1+9+9+1+9+9+9+1 = 48 clocks (one 16-bit register read) to read the result. That's 86 I2C clocks total per sample, 860us @ 100kHz. Incidentally, this is the same amount of (bus) time it takes to run 4 ADCs @ 400kHz.
The a/d conversion takes about 1160us @ 860 SPS, so at 400kHz the I2C is not the limiting factor.

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], pmi2410 and 95 guests