I'm somewhat new to I2C, but really enjoy learning about it. So far I got two Arduinos (one being the master and one being the slave) talking to each other using the I2C.
I also was able to have the master Arduino talking to an external EEPROM (I'm using the 24LC256)
My question to you guys is: How can I get the slave Arduino talking to the external EEPROM?
I understand both Arduinos can't talk simultaneously to an I2C device, but is there a way for the slave arduino to read directly from the EEPROM without having the master Arduino do it and send all the info to the slave?
How would you go about this? Any advice would be very much appreciated. Thank you!
Since the EEPROM is a "dumb" slave only device, you can only talk to it if the Arduino is a master. The Arduino can have both master and slave personality, but not at the same time. You can switch between the two. I'm not sure if any of the library exposes that, but it can be done using low-level drivers.
When the Slave talks to the EEPROM, then the Slave is temporary a Master. But there was already a Master on the I2C bus.
The advanced Arduino users stay away from a multi-Master bus and so should you.
It is therefor not possible.
When two Arduino boards are both Master and both also talk to the same Slave (the EEPROM), then it is beyond "not possible".
There is no solution for this.
One Arduino board should be the Master and control all the data streams over the I2C bus. It is okay to poll a Slave multiple times per second for new data that the Slave might have. It is also possible to poll a Slave to check if the Slave needs data.
Some add an extra wire that is pulled low when an Arduino wants to be the Master on the bus. The Slave Arduino could also indicate via I2C that it wants to become the Master. However, I have not seen a good reliable solution yet.
Can you take a glance at my page about a reliable I2C bus ?
It might help to stay away from trouble.