I2C: Different Senders (Mutil-Level)

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!

Your description is not clear?

1. You have UNO-1 connected with I2C touch screen. Correct?

2. You have NANO-1 connected with say 4 units of I2C ADC (you are calling DAQ = Data Acquision?) chips. Correct? What is the type number of these ADCs?

3. NANO-1 is collecting data from the ADCs when an ADC makes a request through interrupt? Or, NANO-1 is acquiring their data in sequence through polling.

4. After that, UNO-1 collects data from NANO-1 using I2C Bus. Correct?

Now, tell about your problems.

UNO is a MEGA but yes, correct so far. Chips are MCP3424

Thing is, I can use a request from master and handle this in daq. This seems to be working ok. However, I need to tell the slave what data I want. I do this by sending data to it (receive Event on daq) and buffering it. This receiveEvent, however, is causing mess in my i2c buffer and causing read-out-errors and wrong data.
So I see two options:

  1. Always send all data from daq. Then the requestEvent is enough.
  2. Make the NANO (daq) the master. Send data whenever needed. Request data only when i2c is free. Probably the cleanest solution!