Skip to main content
Arduino

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

Multimaster I2C with same address

I use the Wire Library and need to have multi-master setting. I see multi-master examples, where the masters have their own ID's -- which make sense.

Now I have just connected three devices on the bus with the same ID (for example 0x05) and they can communicate! Every node can listen to all traffic, which is not common but this was exactly what I want.

The question is: Will I have trouble in the future? Is my setup something like "multi-slave"?

Answer*

Draft saved
Draft discarded
Cancel
6
  • i tried to keep it minimal but still show complete capability.. i guess im not very good at minimal. Commented Aug 12, 2017 at 7:35
  • //so the basics of the tranmission table - are you writing code, or answering a question? Commented Aug 12, 2017 at 8:01
  • just trying to clearly explain whats going on.. this code is just a massively edited piece of a major project so it was significantly easier to quickly assemble this than try to explain an answer.. after previous comment >>Please, post a minimal but complete sketch that compile OK. Your code is confusing for beginners, because it mix free text with code and have code not inside any function (like loop). – Look Alterno yesterday<< Commented Aug 12, 2017 at 13:25
  • thanks for detailled example. My code is the same like the first example code and works. I have to test the second example. But i dont see any software colision prevention. I would prefer to ignore collided and corupted frames just by a "software master", also there will be a changeable master, which will check communication and if there is collision than will try to fix it. Actually any software solution is better than a third line for me. Commented Aug 12, 2017 at 22:22
  • i havent done anything with collision detection and correcting in software as my hardware solution prevents it but this part >>errorcode = Wire.endTransmission (); if (errorcode != 0 && count <= 2) { count++; // if fail and not exceed count try again Serial.println( "fail" ); goto Tx; } should at least try to make sure the packet is delivered as its probably unlikely for the collision to happen 3 times. Commented Aug 13, 2017 at 23:09

AltStyle によって変換されたページ (->オリジナル) /