I am trying to interface a sensor which sends and receives the data with I2C communication. I have interfaced the sensor with FT232H USB to I2C converter and plugged it to the PC.
I get the dmesg output as follows -
[ 518.172735] usb 1-3: new full-speed USB device number 4 using xhci_hcd
[ 518.306677] usb 1-3: New USB device found, idVendor=0403, idProduct=6001
[ 518.306686] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 518.306689] usb 1-3: Product: FT232R USB UART
[ 518.306692] usb 1-3: Manufacturer: FTDI
[ 518.306695] usb 1-3: SerialNumber: AK04P01W
[ 518.309382] ftdi_sio 1-3:1.0: FTDI USB Serial Device converter detected
[ 518.309442] usb 1-3: Detected FT232RL
[ 518.309445] usb 1-3: Number of endpoints 2
[ 518.309448] usb 1-3: Endpoint 1 MaxPacketSize 64
[ 518.309450] usb 1-3: Endpoint 2 MaxPacketSize 64
[ 518.309453] usb 1-3: Setting MaxPacketSize 64
[ 518.309771] usb 1-3: FTDI USB Serial Device converter now attached to ttyUSB0
and I was able to get the /dev/ttyUSB0 device.
I have run the sample python based application given in the following link -
https://learn.adafruit.com/adafruit-ft232h-breakout/i2c
The code snippet which i was using is as follows -
import Adafruit_GPIO.FT232H as FT232H
# Temporarily disable FTDI serial drivers.
FT232H.use_FT232H()
# Find the first FT232H device.
ft232h = FT232H.FT232H()
# Create an I2C device at address 0x70.
i2c = FT232H.I2CDevice(ft232h, 0x70)
But, it always get stuck at the following line -
ft232h = FT232H.FT232H()
I am not able to come out of the function.
I have followed the steps given in the following link also -
https://unix.stackexchange.com/questions/340789/enabling-i2c-on-debian-i2cdetect-doesnt-show-device
In the above link it shows an example as follows -
So, for example, to read the version, you need to read 01 byte from register 00, the default chip address is E0, the LSB is the R/W bit, so instead you use E1 as address, and the required command for the USB-I2C adapter is 55. So the full sequence you'd send over serial is 55 E1 00 01, and then you'd read one byte as answer.
I am not able to get how to select the values for the following data -
FT232H vs. FT232R are two different chips. The FT232R does not contain the "MPSSE engine", and therefore cannot be used with 3rd-party code examples nor with the FTDI appnote 255 that rely on the MPSSE for i2c master functionality.