FTDI Community
General Category => Discussion - Software => Topic started by: Dete on May 27, 2020, 07:27:32 pm
-
Hello,
is it possible to use a GPIO C0..C9 as an I2C SDA?
I want to connect 2 or more same I2C Devices on the ft232h. The Address from the devices are not changeable.
The SCL are split to every devices and the every devices get his own SDA . In the software i want to switch beetween the devices.
Had anyone an example code in c# for te MPSSE mode?
Greets Dete
-
Hello,
It is possible to use AC0-AC7 as GPIO but AC8/9 are not controllable in MPSSE mode.
You can use MPSSE bit-bang to implement I2C although it will be slower than the usual MPSSE-assisted I2C as it is entirely bit-banged.
We have a small example below which was originally for FT2232H/FT4232H where users wanted open-drain but as it uses MPSSE bit-bang it may be a starting point. it uses the default I2C pins but you could re-code the values so that it drives other pins instead. if using multiple sets of SDA and SCL you would need to implement the I/O writes as mask values so that using one set of pins does not affect to the others (or have a copy of the functions for each pair of I2C pins and just make all other lines an input in each function and call only one at a time). Note that this is just an unofficial example and is not guaranteed or fully evaluated,
BitBang Example (ftp://u45902898-ide:Ftd1$erv@ftp.ftdichip.com/CES/MPSSE/MPSSE_BitBang_I2C.zip)
Alternatively, you can get I2C muxes which allow you to have more than one device of the same address, such as
http://www.ti.com/interface/i2c/switches-and-multiplexers/products.html
Hope one of these help,
Best Regards, FTDI Community
-
Hello FTDI Community,
thanks for the answer and for the example. I will try it.
Greets Dete