General > General Technical Chat
I2C Multiplexer - Simple?
(1/5) > >>
fourfathom:
I want to put two parts on a board that have the same I2C address.  I could use a purpose-built I2C mux chip (such as the Texas Instruments TCA9548A), but is there any good reason why just using a pair of 2:1 analog muxes (like the SN74LVC1G3157 Single-Pole Double-Throw Analog Switch: https://www.ti.com/lit/ds/symlink/sn74lvc1g3157.pdf?ts=1685085821035) wouldn't work?  I would need pull-ups on each of the output ports, but the layout would keep the mux-to-device traces very short.  That mux shows about  30 Ohms max series resistance (with a 3V Vdd).

Am I missing something?  This would sure be cheap and easy.  The on-board controller would select which device it wanted to talk to by switching the mux.
DavidAlfa:
Isn't obvious?

Using analog switches need more I/O, additional Code/routines to do the switching and so on.

The TCA is placed in the middle of the i2c bus, also talks i2c, so nothing else is required, will fit anywhere!
It's easier to implement, just "send this data to this  i2c address".
Switching done!
schmitt trigger:
I personally haven’t done it, but I actually saw it in a commercial product. 
The key is that your switching device must have low “on” resistance.  The regular CD40xx muxes have like 600 ohms at 5 volts. (This value is from my memory, please check the datasheet).
nctnico:
You can use an analog switch (like the 74HC(T)4067 for 16 channels) in the SDA line. I have done this is several designs. Make sure to add a pull-up (like 100k Ohm) to the SDA lines of each output so they stay high.
Infraviolet:
If you desperately wanted to control the multiplexer without needing extra IO lines, didn't want to have to interpret the datasheet of an existing I2C multiplexer and were willing to go with a multiple chip solution...
You could always have non-i2c-specialised multiplexer chips for the two I2C lines, and have these multiplexers controlled from a small microcontroller (ATtiny85 or something equivalent). The microcontroller could watch the I2C lines for customised I2C commands you define and change the multiplexer's state accordingly, you could also program it to disconnect the multiplexer when these customised commands are arriving if they include any byte sequences which might be read and misinterpreted by any existing I2C slave devices beyond the multiplexing area.
Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod