This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Master controlling multiple I2C slaves that have the same fixed address

Other Parts Discussed in Thread: PCA9546A

I have a device that uses I2C to communicate with a small PCA which has an onboard EEPROM with a fixed address and other supporting circuitry.  What I want to do is build a small box that has three or more of these small EEPROM PCAs and use a mechanical switch to select one at a time.

I know I can tie the ground and 3.3v supply to all the PCAs commonly and switch the SDA and SCL lines with a 2-pole switch, but to simplify it a bit more, would it work if I tie all of the SDA lines together and use the switch to tie the master SCL to one of the slave EEPROM PCAs?

Would it make a difference if I tie all the SCL lines together and switch the SDA line to one of the slave PCAs?

... Or am I stuck having to switch both the SDA and SCL lines to select a slave PCA?

I know I can experiment and maybe either option would work but I would rather be sure it's not going to bite me on the backside later.  I just want to be sure.  Later I may opt to use relays or something else (an I2C multiplexer IC?) to perform the same job but I need to use a switch for now.

Thanks for any help or advice!

  • Hi Jim,

    I cannot be positive because I have never tried something like this before but from my perspective I would say that there is no issue with always having SCL connected and switching in SDA to each device as long as SDA is pulled up even when a device is disconnected from the master. With only SCL connected and SDA held high, the I2C device would never see its address or even a start condition so it should never attempt to respond. 

    If you would like an IC option, this exact application is what the PCA954xA series of I2C multiplexer/switches are mainly used for. You could use the 4 channel PCA9546A to connect and disconnect each EEPROM from the master.

    Regards,
    Chris Kraft