Languages

I2c communication between 3 or more objects

I had a late night reflexion about I2C communication with more than 2 devices in a multi-master network. I made a videocast that explains the whole idea. However, my first real-life experiments has raised important synchronization issues with respect to I2C communication in multi-master networks.

The problem can be explained as follow: in a multi-master network containing 3 or more nodes, there is a risk of corrupted data as two masters can write on the same bus. Suppose you have three nodes: A, B and C. A has initiated communication with B and has requested some data from it. It then gets this data using the Wire.receive() function. However, in the mean time, C sends data to A. Then the data A is expecting from B will be corrupted by C. (yeah and, by the way, the network on the image isn't really working, because of that)

There is a very nice I2C FAQ that discusses these issues. In particular, the article Using the clock synchronizing mechanism as a handshake explains how to solve the issue, however it is very low-level and would require adding some new functionalities to the Wire library. See also this article.

So for now I see two ways to go with this project:

  1. Implement those functionalities (high burden + the risk that it won't work)
  2. Make a centralized network instead (one master, many slaves)

Anyway, I believe I'll drop it for now and start working on a simple chained serial communication network.

I had a late night reflexion about I2C communication with more than 2 devices in a multi-master network. I made a videocast that explains the whole idea. However, my first real-life experiments has raised important synchronization issues with respect to I2C communication in multi-master networks.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <h3> <h4> <h5> <h6>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Fill in the blank
By submitting this form, you accept the Mollom privacy policy.