My latest project requires 2 i2c "wire" connections to two identical devices that have the same address, and can't be changed.
Can I instantiate 2 "wire" interfaces, using 4 of the Nano I/O ports (2 for each, obviously), or do I need to use an i2c expansion board, such as the HW-617 using the TCA9548A chip.
The two interfaces will never be active at the same time...
I think I have found my answer, to switch or direct the SDA to each device, and since I'm already including a TCA4468 to multiplex 2 IR transmissions to 2 sky boxes, then I can use the other 2 free channels to multiplex the SDA lines to the 2 devices.
I've also read that you can leave the SCL connected to both, and if the unswitched one doesn't receive any data it doesn't complain.
Anyone have anything to add to that, possible problems etc. ?
Grumpy_Mike:
Just don't believe everything you read.
Why do you think disconnecting SDA is wrong and SCL is OK? I would expect the device with SCL disconnected will see a lot of START and STOP conditions which may confuse it. OTOH with SDA disconnected transitions on SCL will be ignored since the disconnected device does not see the START condition...
TomGeorge:
Hi,
As long as the I2C device doesn't see a clock TRANSITION it doesn't read the I2C SDA.
Tom...
No, this is not true. START and STOP condition is defined as SDA transition while SCL is HIGH. So I2C device samples SDA line while SCL is HIGH continuously.
In your example it does not matter - the "deselected" device has SCL LOW. In other implementation if the SCL line were kept HIGH deselected device would see series of START and STOP conditions.
IIRC STOP condition should not follow directly a START condition but I may be wrong. OTOH I am not sure if it is allowed toggle clock without previous START.
EDIT: @Grumpy_Mike - I do NOT want to start an argument. In fact I did not notice it was your post until I started typing my original question. I really want to know why do you think keeping SCL connected is wrong. Or did you mean the comment more general? Such as "despite this particular advice is not bad don't blindly follow everything you read unless you know what you are doing"?
Hi,
I used a CAD program called ExpressPCB, it does schematics and PCB, but not a gerber for PCB manufacture, it does a file for the PCB group that supplies ExpressPCB for free.
I use it for schematics because it is easy to use and make your own components.
This page explains some of it and has the download button.