Xiao esp32s3 - two i2c slaves

Hi,

I’m trying to setup xiao esp32s3 to work as slave on two separate i2c buses (one is raspberry pi that likes to be master) other is lilygo T-RGB (also like to be master for his own stuff)

First issue:

  • if I init wire like this
    Wire.begin(SLAVE_ADDRESS);
    everything is fine, but if I try to specify address
    Wire.begin(SLAVE_ADDRESS,5,6);
    it does not work … (or 4,5 … tried most permutations) … is it pin numbers or not possible?

Second
Can you make ESP32 to have 2 i2c slaves or not? … because I see that it can have two buses as master

If not xiao esp32s3 what else?

thanks,
B

are you using Arduino IDE? May be a pin naming thing… Physical Pin v/s Logical pin number… If you are not using the correct back setup the pin numbers will not be correctly defined. in alot of these libraries the pin numbers are not variables but defined

some places say you need special dedicated IIC cicuit in the processor for IIC… (in this case the XIAO has only one) others say you can choose the pins… others say you have to bit bang on other pins

I would say try using the UART port… Pins D6 and D7 but use the GPIO pin numbers 43 & 44 (as shown on the image… each device may be different)

I am using Arduino IDE …

Tried to turn the led on off on other pins… Plain GPIO numbers are correct (just don’t write GPIO)

I’ll get full size esp32wroom tomorrow … they have all the pins :slight_smile:

And it looks like a bug to me …

You can use this device and the pins as discribed above and the top two grove ports are IIC 1 and set the bottom right UART port to be IIC 2 . The top two are hard wired to IIC the bottom left port is not able to be used that way… as it is only three wire

this device could also be used

where did you see this?

ESP32 … i2c1: pin 21,22 and i2c2: 16,17

chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://files.seeedstudio.com/wiki/SeeedStudio-XIAO-ESP32S3/res/esp32-s3_datasheet.pdf

The pin may need to be set as pull up or pull down

Figured it out … I was (kind of) stupid …

When setting up slave you have to provide 4 params, I was giving 3 (which sets up a master)

Wire.begin(SLAVE_ADDRESS_1,5,6,100000UL);
Wire1.begin(SLAVE_ADDRESS_2,1,2,100000UL);

Hope it helps someone …

RTFM