Page 1 of 1

synchronisation i2c esp32 (esp-idf)

Posted: Wed Jun 17, 2020 8:24 am
by mohasrj
hi everyone,

I want to connect until 8 device i2c to my esp32 (the same or different device like i can connect 8 bme280 or
-2 bme280
-2 BH1750
-2 expender mcp2307
-2 ADC3428 .... )

i dont know what is the best method to do that, i try to use mux TCA9548A but i dont know how i can do synchronisation between all task

and i find in github library i2cdev https://github.com/UncleRus/esp-idf-lib but i dont understand well how it work (install driver for each device ... ) so i cant add other device.

i dont know in my case what is better use i2cdev or directly write simple program to read each i2c slaves one by one and how i can do synchronisation between all device task ???

i2cdev : https://github.com/UncleRus/esp-idf-lib

normal i2c : https://www.lucadentella.it/en/2017/10/ ... i2c-basic/

i2c_self_test https://github.com/espressif/esp-idf/bl ... ple_main.c


best regard,

Re: synchronisation i2c esp32 (esp-idf)

Posted: Wed Jun 17, 2020 11:11 pm
by PeterR
Usually you do not need an I2C mux. Instead you use pull ups on the actual devices to give each an address. You may then use a single I2C channel to talk to each device on its (pull up) address.
I have not checked if you have address conflicts with you're parts nor details on how the TCA9548A mux works.
Maybe you could just allocate 2 pins to another I2C channel? Seems a step around solution - if you have the pins. That or look for different devices. You have quite a few devices on one channel so maybe you will have unresovable address conflicts but typically then you would choice another device so as to avoid conflict & rather than add more silicon.
Publish your address options, what are the problem conflicts?