Hi, I have the exacly the same system as in this link :
But I need to add a 3rd card, a Due.
It seems like it is more of a 2 slave with the
Wire.begin(0);
Wire.begin(1);
I need all 3 cards to performe critical speed opérations, so I need to send data without the onRequest, that a master would send. Is I2C the best for a few bytes data, sent really fast, beetween 2 Uno A4 A5 and a Due 20 21 ?
I use a logic voltage converter 5 to 3.3 compatible with I2C, and all grounds are connected.
Nothing works even with only a Uno and the Due
That link is full of beginner mistakes. Only beginners try a multi-master I2C bus, because there are many pitfalls and it will only bring trouble.
Can you tell what your project is about ?
Is it possible to do your project with a single (fast) Arduino board ? Maybe your sketch is not suitable yet to do multiple things at the same time, but that can be fixed.
The slave continuously checks the digital ports in the void loop, and when a change is detected, and sends a structure with all the data, and the slave must read I2C for commands:
It works, I don't need Wire.requestFrom, because it's my slave that knows when to send data.
My master also needs to send data to the slave, so I use the same logic of beginTransmission and change the address
Umm. Serial? How far apart? Serial can run much higher than 200kbaud (I've seen references to 2Mbaud, but haven't tried that), and if you need faster than that it's possible you've got the wrong processor in mind anyways; Due and Uno are a tad long-in-the-tooth at this point.
C
Sorry I see many future problems without assuming any hardware problems because of line length and capacitance. I2C is not really fast. Take a look at CAN, much easier to use and faster. CoryJFowler has posted a great library that comes with a simple send and receive examples. These can be combined into one sketch quite easily. The MPC2515 (CAN) modules are not very expensive. You can put 20 or more nodes on it if you want and wire a few hundred meters/yards is no problem.