Using digital pins to drive alternate i2c bus
Does anyone know if its possible to drive an i2c bus with the digital pins on the Arduino? I'm trying to string together many meters of blinkMs and I thought that driving multiple busses would be a way around this. The problem is that even though my longest cable is under 12 feet and works great, it maxes out that bus so no other cables can tie into it. Any comments greatly appreciated.
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?Hi,
It is possible to do a "software I2C master" on any pair of digital pins, I think I've seen some discussion of it on the Arduino forums. The easiest way would probably be to use Peter Fleury's software I2C master code:
http://homepage.hispeed.ch/peterfleur...
It has some limitations as an I2C master, but should work fine for BlinkMs.
As for extending I2C bus length, that is an issue. I2C was designed to be a used only on a circuit board, not over cables. Not that that's stopped people from trying. :) The theoretical length using standard ribbon cable is around 8m. This is because as the cables get long, they start to act like a capacitor, which slows down changes in the data signals, making them hard to read. To counteract this, you can use external "pull-up" resistors to make the signals restore faster.
Instead of the standard 4.7k resistors, use lower values on longer bus lengths. Try 2.2k or 1.5k.
See a discussion of bus length here:
http://www.i2cchip.com/i2c_connector.html#Bus%20Length
For some info on I2C on Arduino, see:
http://www.uchobby.com/index.php/2008/09/16/introduction-to-i2c/ -
Inappropriate?I2C is a very robust system and there are a lot of components for working with I2C networks out there. There are IC's that do long haul I2c; i2c repeaters and expanders. i2c optoisolaters, non-disruptive i2c hotplug devices, etc. You can build quite complex networks with i2c if you have a strong stomach.
See the applications section in this document, for examples:
http://next.nxp.com/acrobat/applicati...
Loading Profile...



EMPLOYEE