Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: jcottrill on April 11, 2018, 11:17:00 AM
-
Are there any plans to produce an I2C POM module or are there any code samples out there for a bit-banged implementation? There are a few I2C based sensors I'd like to integrate into my designs. It would be nice if this was supported directly via a module and/or function but I'd shamelessly steal existing code before writing my own if someone is willing to share :)
-
One benefit of the POM approach would be it could likely encapsulate the level shifting needed. Not that this is a difficult task but would be nice to avoid.
-
Is the I2C interface the same one used by the Vex Robotics Cortex processors to talk to some IO? I ask because as I understand it this interface was designed for internal communications and when brought out to the real world is very noise sensitive as it is very low power.
-
I am not familiar with the Vex but I2C is a standard so they should be the same. You are correct in that it serves primarily for internal communications over short distances.
The primary sensors I was looking to are some color and light sensors. In our setup the sensor itself could be kept close to the PLC and fiber optics or other light pipe could transmit the light we are inspecting from the source to the sensor.
If memory serves me right, the bus can be extended if the proper capacitance is maintained along with shielding, buffers etc. I don't think I want to be on the far side of crazy though. If all else fails I can add a few micros into the system to collect the data and use RS-485 to transmit back to the PLC. It would be nice to avoid the extra micro though if reliability isn't sacrificed.
-
We added INI (Immediate In) in 2.2 to make it possible to bit bang. OUTI was already there. I could probably hack together a simple I2C implementation.