PaoloP74/extEEPROM

Clarification about using multiple I2C devices

Closed this issue · 2 comments

Hello,

Thank you for providing this library ... it seems to be working well!

I do have one question in trying to better understand the library design, and how we can use this for our purposes. When I read the documentation, it appears that the Constructor allows us to provide a "nDev" parameter that represents the number of devices on the bus. If we do this, should we understand that you will then treat the set of devices as one consecutive chunk of EEPROM? And the addresses must be sequential and in order?

In our case we have a "motherboard" that can have up to 5 different daughter cards plugged in. We are using the I2C EEPROM on each daughter card to determine which card is plugged into which socket ... and some sockets might be empty.

So my real question is the best way that we could use your library to iterate the 5 addresses for each socket (0x50-0x54), detect if the EEPROM is present, and then read or write them.

I was thinking of trying to create an array of extEEPROM objects and iterate them, but in the Constructor I have to pass the I2C address ... and so I wasn't sure if this would work?

I would appreciate any suggestions on the best way to accomplish this ... and if there is a better place to post this question please let me know.

Hello
the i2c connection is not designed for removable or plug & play units.
For example, the i2c implemented in the arduino core blocks the code execution if the device is not reachable. There is no timeout.
To know how the library works I suggest you ask the original author.
I simply keep it updated for compatibility with the ide of arduino.

I'm sorry for my english.

Hello,

Thank you for the reply ... I actually did getting it working exactly as I had hoped! :-)

I created a for loop that instantiates and queries each EEPROM, and it does timeout fine when no device is detected. We're able to now do exactly what we wanted.

Thank you again ... and your English is fine! :-)