I2C Information

5V on the I2C is fine

I love i2c and use it for almost all my projects. Two other points to add to this thread.

  1. Usually the length of the i2c wire is limited to about 10m - and it gets dicey before that. I wanted to extend the range of my i2c devices to about 60m so I built a simple in-line i2c range extender board. You can check out the documentation here and make your own easily.

  2. i2c implementations usually have a number of “slave” devices which can peacefully co-exist on the bus. However, sometimes you want to have more than one “master” which can be an effective way to share state and data between microprocessors (like multiple Photons). I documented an approach and wrote some software to enable this “multi-master” i2c bus more robustly than the built in multi-master capabilities than the standard Wire.h library.

I hope this is helpful.

Chip

3 Likes

Very useful work @chipmc !
I will try it out: I experienced the vulnerability of I2C connections…

:+1: :older_man:

1 Like

Here is another interesting source of extra tips: LINK

As mentioned in this text, (and in the P82B96 datasheet) it’s important to combine the lines in two twisted pairs as follows:

  • Twisted pair 1 = +Vcc and SCL
  • Twisted pair 1 = Gnd and SDA

" DON’T put SDA, SCL together, especially don’t twist them together. Twist SDA with VCC and SCL with GND, and have 100nF between VCC and GND at each end. (If you look carefully in the 82B96 circuit you will see that NXP show the bus wires arranged this way.) "

1 Like

In the document (above link) it is said:

“be aware of I2C bus lockup, which can be caused by extra (noise) clock pulses, and make sure that you master can clear it. Section 19 of our bl233 datasheet explains bus deadlock.”

I experienced this “deadlock” with an I/O expander.
When I send a reset command remotely, the Photon can’t reset the I2C bus…

Does anybody have any idea of how this can be done with a Photon?

Thank you so much for your post. It taught me how to use the mac SerialTool. It showed me the actual channel my I2C was on and that let me change the code in the ads1115.h file to find the dang thing. Thank you again. I was also able to verify that readings are being sent. Great post.

One note. I had to check the boxes on the serial tools app for RTS and DTR to get the values to show.