Page 1 of 1

I²C to more I²C expander?

Posted: 23 Nov 2019, 17:11
by M*I*B
Hi friends of short circuit,

for a new "try and error" project I have to less I²C adresses to choise. So I need a Chip to expand the single ESP-I²C to more, i.e. 4 more Ports... I know that this type of chip exist but I can't find them..

Any helpfull out there? :D

Re: I²C to more I²C expander?

Posted: 23 Nov 2019, 17:31
by TD-er
See plugin 9 - MCP23017
plugin 19 - PCF8574

Or isn't that what you meant?

Re: I²C to more I²C expander?

Posted: 23 Nov 2019, 18:09
by M*I*B
... nope, that's wrong. I don't need more simple IO's, I need more I²C busses due I have many sensors with the same and unchangeable I²C- Adress ... The Chip simple shift the Baseadress of the Busses if I remember right...

Chip have i.e. 0xAB00 then ...
... ext. bus 1 is ACxx where xx are the adresses of the slaves at this bus
... ext. bus 2 is ADxx where xx are the adresses of the slaves at this bus
... ext. bus 3 is AExx where xx are the adresses of the slaves at this bus
... ext. bus 4 is AFxx where xx are the adresses of the slaves at this bus

Re: I²C to more I²C expander?

Posted: 23 Nov 2019, 19:20
by TD-er
Well as far as I know this is not possible.
If there would be such a chip, then we must also add support for it to make sure commands for each are sent to the right bus.

Re: I²C to more I²C expander?

Posted: 23 Nov 2019, 20:10
by M*I*B
... hmmm, I think no... If I remember right the Data are transparent. The only thing to do, in my opinion, would be to expand the bus scan area to include the extended area. For the ESP, the chip is in fact not visible. The ESP sees only the I²C clients, which only now have a different address than native

Re: I²C to more I²C expander?

Posted: 24 Nov 2019, 02:53
by ThomasB
PCA9518 might provide the I2C expansion feature for your application.
http://www.ti.com/lit/gpn/pca9518

- Thomas

Re: I²C to more I²C expander?

Posted: 24 Nov 2019, 10:43
by Flying Domotic
You may also have a look at https://github.com/MajorLee95/nanoI2CIOExpander, using a nano as I2C IO expander

Re: I²C to more I²C expander?

Posted: 24 Nov 2019, 12:14
by M*I*B
@ThomasB:

Yes, you hit the 1st target; thx a lot ;o) This chip does almost what I need. The good news about this chip is that you are calling all clients with the same address by choosing the correct extension port. The problem I see is that you need at least two additional ports to switch between two extension lines or, if you place a bin2hex chip in between, three extensions (see table on side 11).
I'm hopefull to find the one I described before. But if not I will give them a try .

@Flying Domotic:
Ty also for that. Looks also like a good idea, but for my projekt a too much space grabbing version...

Re: I²C to more I²C expander?

Posted: 24 Nov 2019, 13:11
by TD-er
It still needs an extension to the software to trigger the right GPIO pin for enabling the correct I2C bus.
I think it should be done by making a wrapper to the Wire interface.
Meaning it is not a plugin, but something at the core of ESPEasy, or else you have to adjust every single plugin to adapt to this.

Re: I²C to more I²C expander?

Posted: 24 Nov 2019, 19:19
by ThomasB
The problem I see is that you need at least two additional ports to switch between two extension lines or, if you place a bin2hex chip in between
To save ESP GPIO pins, your i2c extension selection could be handled by a i2c GPIO expander chip. There are plugins for the MCP23017 and PCF8574.
It still needs an extension to the software to trigger the right GPIO pin for enabling the correct I2C bus.
I think it should be done by making a wrapper to the Wire interface.
A wrapper would be convenient indeed. But to test out this "try and error" project there may be a temporary workaround that uses rules to control the i2C extension selection and also perform the R/W to the selected i2c device.

- Thomas

Re: I²C to more I²C expander?

Posted: 25 Nov 2019, 21:47
by M*I*B
... japp ... For that T&E I will use the PCF8574 to control the PCA9518. Maybe later then I find the special chip I'm talking about, if the T&E goes to success ;o)

Re: I²C to more I²C expander?

Posted: 25 Nov 2019, 22:37
by ThomasB
Maybe later then I find the special chip I'm talking about, if the T&E goes to success
Here's some candidates for that special chip:
LTC4316, https://www.analog.com/media/en/technic ... 4316fa.pdf
LTC4317, https://www.analog.com/media/en/technic ... 4317fa.pdf
MAX7356, https://datasheets.maximintegrated.com/ ... AX7358.pdf

I think that the LTC431x are brilliant because there would be no changes needed to an existing ESPEasy Plugin. But only available in DFN package.

The MAX7356 is similar to the PCF8574 / PCA9518 solution, so not as clever as the LTC431x. And it would require a custom plugin. But this single chip solution is available in SSOP package for easier DiY soldering.

- Thomas

Re: I²C to more I²C expander?

Posted: 25 Nov 2019, 23:12
by TD-er
Hmm those are indeed brilliant :)
Only thing that may need to be changed for only some plugins is to add some extra addresses for the configuration.

Re: I²C to more I²C expander?

Posted: 25 Nov 2019, 23:28
by ThomasB
Only thing that may need to be changed for only some plugins is to add some extra addresses for the configuration.
Oh pooh. That will indeed require a code change to a plugin with fixed i2c address choices.

But on a positive note, I just noticed that the LTC431x chips are also available in MSOP package; Substantially easier to hand solder than DFN.

- Thomas

Re: I²C to more I²C expander?

Posted: 25 Nov 2019, 23:32
by TD-er
ThomasB wrote:
25 Nov 2019, 23:28
[...]
Oh pooh. That will indeed require a code change to a plugin with fixed i2c address choices.
Not to mention years of beta-testing...
Maybe even setup a voting committee to select the most appropriate addresses for the selection and a test panel to make sure the offered choices are political correct and will not offend anybody. (and also those without a body, just to make sure no man/woman/etc. feels excluded)

Re: I²C to more I²C expander?

Posted: 26 Nov 2019, 00:05
by ThomasB
I found an abandoned ESPEasy pull request for adding the TCA9548A i2c multiplexer chip. It is similar to the MAX7356 chip (but easier to purchase).
https://github.com/letscontrolit/ESPEasy/pull/254

I didn't dig into the PR's details, but it is interesting; It shows that someone else has traveled on this road before.

- Thomas

Re: I²C to more I²C expander?

Posted: 26 Nov 2019, 00:14
by M*I*B
Not to mention years of beta-testing... .../... not offend anybody. (and also those without a body, just to make sure no man/woman/etc. feels excluded)
:lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol:
GREAT!

AND: Yippie Yah Yei!!! The TCA9548A is exact the Chip I have searched for... Now tomorrow I can go to Berlin with peace of mind and kick some politicians to the shin ... :D

Re: I²C to more I²C expander?

Posted: 26 Nov 2019, 10:31
by krikk
the TCA9548A multiplexer chip was working fine with my commit, but someone else has do update my PR to the newer codebase, sorry i do not have the time for such a project now, good luck would be really usefull if this will be integrated in the code...