Interface Modules
Jump to navigation
Jump to search
Hardware
USB to I2C Slave
- "CJMCU-200" with FT200XD chipset
- Not very useful
USB to I2C Master
- "CJMCU-232H" with FTDI chipset FT232HQ (also including UART, SPI and GPIO)
- Datasheet
- Application Note
- Appear as /dev/ttyUSB0
Software:
- Linux: python3-pyftdi
/etc/udev/rules.d/11-ftdi.rules:
# FT232AM/FT232BM/FT232R SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", MODE="0664" # FT2232C/FT2232D/FT2232H SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6010", MODE="0664" # FT4232/FT4232H SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6011", MODE="0664" # FT232H SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6014", MODE="0664" # FT230X/FT231X/FT234X SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6015", MODE="0664"
python3:
>>> from pyftdi.ftdi import Ftdi >>> Ftdi.show_devices() Available interfaces: ftdi://ftdi:232h:2:b/1 (Single RS232-HS
Show device URLs:
ftdi_urls.py
Show I2C devices on bus:
i2cscan.py ftdi://ftdi:232h:2:b/1
BME820 I2C Temp/Humidity Sensor
- Schematic
- Default address: (Jumper can be moved to switch 0x77 / 0x76)
TinyRTC
- Default address:
Linux Interface
Packages: i2ctools, python-i2c
Detect buses:
i2cdetect -l
BME820 I2C Temp/Humidity Sensor
- Schematic
- Jumper can be moved to switch address from 0x77 to 0x76
Linux Interface
Packages: i2ctools, python3-i2c-tools
Detect buses:
i2cdetect -l
Board "CJMCU-232H" using the FTDI FT232H device. Similar to this.
- Datasheet
- Application Note
- Appear as /dev/ttyUSB0
USB interface to:
- UART mode (default operation, at 9600 8N1)
- MPSSE mode
- SPI
- I2C Master
- FTDI Drivers and libraries
- D2XX drivers
- I2C library built on D2XX
- SPI library built on D2XX
- Open Source Drivers and libraries
- libFTDI
- libmpsse library for SPI and I2C built on libFTDI
- ADAFruit Python interface for SPI, I2C and GPIO built on libFTDI
Pinouts:
Pin | UART Function | SPI | I2C | GPIO |
---|---|---|---|---|
C0 | ||||
C1 | ||||
C2 | ||||
C3 | ||||
C4 | ||||
C5 | ||||
C6 | ||||
C7 | ||||
C8 | ||||
C9 | ||||
D0 | TX | |||
D1 | RX | |||
D2 | /RTS | |||
D3 | /CTS | |||
D4 | /DTR | |||
D5 | /DSR | |||
D6 | /DCD | |||
D7 | /RI |