The I2C (Inter-Integrated Circuit) bus was designed by Philips in the early '80s to allow easy communication between components which reside on the same circuit board. TWI stands for Two Wire Interface and for most marts this bus is identical to I²C. The name TWI was introduced by Atmel and other companies to avoid conflicts with trademark issues related to I²C.
I2C bus consists of two wires, SDA (Serial Data Line) and SCL (Serial Clock Line). You can see I2C pins on OpenMV board, shown in Figure below.
For OpenMV Cam M7, OpenMV provides two I2C bus on I2C2(SCL,SDA) on P4 and P5. The other is I2C4(SCL,SDA) on P7 and P8.
For testing, I used PCF8591 AD/DA Converter module with sensor and actuator devices. You can find it on the following online store:
In addition, you can find this device on your local electronics store/online store.
This module has mini form model too, for instance, you can find it on Amazon, .
This module use PCF8591 IC and you can read the datasheet on the following URLs.
In this chapter, we build a program to access sensor via I2C using OpenMV IDE.