Hi,
I have a question trying to build an I2C setup. Let me try to describe the setup:
There’s one Arduino running a touch display, let’s call him “master”.
There’s another Arduino connected to multiple DAQs, let’s call him “daq”.
Right now, I have just tested the daq. In the setup(), I connect to I2C using Wire with a specified address:
Wire.begin(0xA0)
and then later on in the code (especially in libraries designed to read the specific AD ICs) something like the following multiple times...
Wire.beginTransmission(adr)
Wire.requestFrom(adr, bytes)
Wire.available()
Wire.endTransmission()
Now to the fun part. Master is supposed to get some of the data that daq read via I2C. So in Master, there’s also
Wire.begin()
Wire.requestFrom(0xA0, bytes)
Which then is supposed to trigger an interrupt on daq and send the asked values. However, when I use
Wire.onRequest(sendToMasterRoutine)
on daq, its messing up due to the other I2C request when accessing the AD ICs triggering it.
So much description, the final question: Can I only trigger an interrupt on daq when there’s a request from a specific sender? Am I doing something wrong elsewhere since the connected AD ICs aren’t requesting, they are reacting to daq (Why is it triggering the ISR?)
I specifically want to split the display Module from the DAQ Module so running all on one Arduino is (at least right now) not an option. I could, however, use SPI as a second BUS. I would like to stick to i2c for simplicity though.
Cheers!