Dear all, please, can I use one ESP32 board as Slave and Master for two I2C devices ? I sniff I2C data from an external I2C device (data for an OLED display) (SLAVE role) and would like just for testing for purposes to forward the data to an OLED display (MASTER role).
Thank you in advance.
I2C Master and Slave with one ESP32 board
-
- Posts: 1708
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: I2C Master and Slave with one ESP32 board
So yeah, it should be possible to have one controller as a slave and one as a master.ESP32 has 2 I2C controller (also referred to as port) [...]. A single I2C controller can operate as master or slave.
However, the ESP-I2C controllers are a bit "special" in what they can and cannot do in slave mode. Just auto-ack'ing and piping through all non-address bytes received should be feasible though.
Re: I2C Master and Slave with one ESP32 board
I would highly recommend to get a simple logic analyzer. I2C protocol is slow enough and you can get a cheap logic analyzer using 8 channels and 24MHz for like $10-$20 or so.
It will let you analyze I2C and even extract the exact data it's being sent over to your device.
It works completely transparent for both ends.
It will let you analyze I2C and even extract the exact data it's being sent over to your device.
It works completely transparent for both ends.
Re: I2C Master and Slave with one ESP32 board
Yes, I use a copy of Salae logic analyzer to sniff the data from the I2C bus to comepare the data with the data sniffed by the ESP32 board. There is long way behind from Arduino Nano/UNO boards to ESP32 boards used with Arduino IDE to ESP-IDF where we finally got the same data as from the logic analyzer. No I am trying to check the reliability and playing with the buffer size and the portTICK_PERIOD_MS value.
Next step would be to test the data sniffed by the ESP board with the OLED display before we start to re-write everything made in IDE to ESP-IDF.
Next step would be to test the data sniffed by the ESP board with the OLED display before we start to re-write everything made in IDE to ESP-IDF.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 139 guests