FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.

Messages - petewall

Pages: [1]
1
Discussion - Software / Cannot find FT4222 chip on Windows
« on: May 07, 2018, 08:32:49 PM »
I'm still working on debugging my other issue (http://www.ftdicommunity.com/index.php?topic=83.0).  While I was able to detect the FT4222 chip on my Mac OS X machine, when I built the software on Windows 10, I cannot see it.

To reduce any issues with my code, I'm using the i2c_master example.  In the code, after the call to:
Code: [Select]
FT_STATUS status = FT_CreateDeviceInfoList(&numOfDevices);
numOfDevices is always 0.

However, when I look at the Windows Device Manager, I do see a "FT4222H Mode 3 Device" entry in the "Universal Serial Bus controllers" section.

I installed the D2xx drivers (http://www.ftdichip.com/Drivers/D2XX.htm) using the Windows setup executable. Can you help me detect this device in my code?

2
Discussion - Software / Issue with FT4222 and I2C
« on: April 25, 2018, 03:25:59 PM »
I am having some trouble communicating with a chip over I2C and I'm wondering if I'm doing something wrong when setting up the FT4222 chip.

Some overview of my circuit, I have the FT4222 chip connected to my computer over USB, and I want to use it to communicate to other chips on circuit over I2C.  The first chip to communicate with is a PCA9570, a four pin GPIO chip, that controls two LEDs and two reset pins for other chips on the board.  Initially, the PCA9570 is high on all four outputs, so my first job is to tell the PCA9570 to set those outputs low.

I'm building the software on Mac OS X 10.13.4, with g++:
Code: [Select]
$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.1)

Here's an overview of the software:
I find any available chips...
Code: [Select]
FT_CreateDeviceInfoList(&numOfDevices)... connect to the first one...
Code: [Select]
FT_OpenEx(locationId, FT_OPEN_BY_LOCATION, &ftHandle);... Initialize I2C...
Code: [Select]
FT4222_I2CMaster_Init(ftHandle, 400);... and reset I2C.
Code: [Select]
FT4222_I2CMaster_Reset(ftHandle);
All of these succeed with FT_OK return codes.  A call to FT4222_I2CMaster_GetStatus returns 0x20 (controller idle).

The PCA9570's data sheet (https://www.nxp.com/docs/en/data-sheet/PCA9570.pdf) specifies running these commands.  First, I send the general I2C reset (sending 0x06 to 0x00):
Code: [Select]
uint8 buffer = 0x06;
uint16 sizeTransferred;
FT4222_STATUS status = FT4222_I2CMaster_Write(ftHandle, 0x00, &buffer, 1, &sizeTransferred);
This succeeds and another call to FT4222_I2CMaster_GetStatus still returns 0x20 (controller idle).

Now, I send the command to pull all pins low on the GPIO chip:
Code: [Select]
uint8 pins = 0x00;
uint16 sizeTransferred;
FT4222_STATUS status = FT4222_I2CMaster_Write(ftHandle, GPIO_CHIP_ADDR, &pins, 1, &sizeTransferred);

The status for this is still FT_OK, but the LEDs are still on.  Also, the next call to FT4222_I2CMaster_GetStatus returns 0x3e.

So, how can I best debug why my I2C commands are not going through?

Pages: [1]