How to communicate between 3 devices

arduinocommunicationi2cmicrocontrollerprogramming

i want to communicate between uno, mega and netduino, which protocol should i use

i want the uno and mega to send information to the netduino which mean that i don't need duplex connection which mean i could go for I2C with both as master writer and netduino would be slave reader, would that work ?

distance is 2 to 3 ft and i duno about other limitations it's kind of why i'm asking in the first place

any tips or information is appreciated, thanks in advance

also i'm using easy VR shield and wifi shield, would that be a problem ? thanks

Best Answer

Your setup as you described it has two masters. That means that you should look for multi-master I2C support in your devices' hardware and protocol stack that you're going to use if you stick with I2C. I2C from my experience is a very, ehm..., whimsy, especially when it comes to I2C slave implementation. Most microcontrollers, although claiming support for both master and slave modes, work best in master mode.

If I were you, I would probably look into using CAN as it is originally designed for multi-device intercommunication.

On the other hand, if you want simplicity and only need to send short messages from time to time, you may even go with 1-wire, which in my opinion is much more robust (both protocol- and interference-wise) than I2C and is much simpler in implementation than both CAN and I2C. It doesn't even need special hardware support and can be implemented on pure GPIO lines (with interrupts, preferably).