FTDI Community

General Category => Discussion - Software => Topic started by: nroos on May 18, 2020, 06:02:35 PM

Title: A linux, a UM232H and a I2C device - now what do i do with it?
Post by: nroos on May 18, 2020, 06:02:35 PM
Hello,

Is there maybe a guide what i actually have to do to connect a I2C slave device to a PC and communicate with the device in Linux? For the conversion i would use a UM232H module.

The application notes i found so far explained always just a part, not the big picture. With the research i have done so far i found out that using D2xx and libMPSSE should do it on the software side. Compiling was successful, running the static example (static_link) also until it waited for incoming data.

But now what do i do with the UM232H? Do i have to configure it somehow? To which of the 16 connections do i attach my I2C device? I looked at the wires with a scope; one wire obviously had a data transfer on it. But there was no wire with the clock...

It would be really helpful if there was a document which just says: Do this, do that and so on, to avoid all this time consuming research.

Kind regards

Title: Re: A linux, a UM232H and a I2C device - now what do i do with it?
Post by: FTDI Community on May 21, 2020, 04:42:31 PM
Hello,

To use I2C with FT232H, see AN_135 FTDI MPSSE Basics (https://www.ftdichip.com/Documents/AppNotes/AN_135_MPSSE_Basics.pdf) and our existing MPSSE Example projects:

http://www.ftdichip.com/Support/SoftwareExamples/MPSSE.htm (http://www.ftdichip.com/Support/SoftwareExamples/MPSSE.htm)

There are two options to use I2C modes with the MPSSE engine:

a. Use LibMPSSE libraries. Example code is provided with the download.

b. Use D2XX drivers direct. Example code is shown at I2C (https://www.ftdichip.com/Support/SoftwareExamples/MPSSE.htm#I2C).
AN_108 Command Processor For MPSSE and MCU Host Bus Emulation Mode (http://www.ftdichip.com/Support/Documents/AppNotes/AN_108_Command_Processor_for_MPSSE_and_MCU_Host_Bus_Emulation_Modes.pdf)s provides the necessary information.

Option b is the best option to use the D2XX drivers direct (no dependency on libMPSSE library).

Best Regards,
FTDI Community
Title: Re: A linux, a UM232H and a I2C device - now what do i do with it?
Post by: nroos on May 26, 2020, 08:26:08 AM
Hello and thanks for the reply,

I have done already what you describe. And what do i have to do next to communicate with a I2C device? Do i have to put the UM232H into I2C mode, or ist the software doing this? Which pins are the I2C pins? Do the pins need external pullups or are they chip-internal and can be controlled by software?

As described, i don't see the complete I2C signals on the pins. I have seen one pin which had some kind of data on it, but there was no I2C clock on any pin, so the data i have seen could just be a RS232 signal or something like that...

Kind regards
Title: Re: A linux, a UM232H and a I2C device - now what do i do with it?
Post by: FTDI Community on May 29, 2020, 05:14:53 PM
Hello,

The application code on the PC would enter MPSSE mode then I2C can be configured.

External pullups are required.

The pins required are clear in the documentation:

ADBUS0 –SK/CLK
ADBUS1 –DO
ADBUS2 –DI
ADBUS3 –CS

Note that from AN_135, DO must be connected to DI externally as well.

Best Regards,
FTDI Community