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

Author Topic: Issues using FT260 to communicate over I2C  (Read 409 times)

mattmcguinness

  • Newbie
  • *
  • Posts: 1
    • View Profile
Issues using FT260 to communicate over I2C
« on: April 27, 2022, 03:13:40 PM »

Hi everyone,

I'm currently trying to use an FT260S as a USB-I2C master to communicate with a couple of slaves. I'm trying to write the program in C# using the LibFT260 library and I'm using the AN438 code as an example but when the code tries to init and get the status I get errors.

Initialising the master gives an INCORRECT_CHIP_MODE
Getting the status gives an IO_ERROR - It returns 0 which I believe is busy?

Opening the device by VID is fine and when I call GetChipVersion(), I get "39846400" which looks like a valid version number.

Question 1 - Are these error codes documented anywhere?
Question 2 - What am I doing wrong? Is the chip wired up incorrectly? I have pull up resistors on the pins required for I2C comms is there anything else?

Thanks in advance
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 749
    • View Profile
Re: Issues using FT260 to communicate over I2C
« Reply #1 on: April 28, 2022, 04:51:07 PM »

Hello Matt,

You can find the error codes in LibFT260.h which is included with LibFT260:

Code: [Select]
enum FT260_STATUS
{
                FT260_OK,
                FT260_INVALID_HANDLE,
                FT260_DEVICE_NOT_FOUND,
                FT260_DEVICE_NOT_OPENED,
                FT260_DEVICE_OPEN_FAIL,
                FT260_DEVICE_CLOSE_FAIL,
                FT260_INCORRECT_INTERFACE,
                FT260_INCORRECT_CHIP_MODE,
                FT260_DEVICE_MANAGER_ERROR,
                FT260_IO_ERROR,
                FT260_INVALID_PARAMETER,
                FT260_NULL_BUFFER_POINTER,
                FT260_BUFFER_SIZE_ERROR,
                FT260_UART_SET_FAIL,
                FT260_RX_NO_DATA,
                FT260_GPIO_WRONG_DIRECTION,
                FT260_INVALID_DEVICE,
                FT260_INVALID_OPEN_DRAIN_SET,
                FT260_INVALID_OPEN_DRAIN_RESET,
                FT260_I2C_READ_FAIL,
                FT260_OTHER_ERROR
};

If you are seeing FT260_INCORRECT_CHIP_MODE then check the hardware configuration.
See FT260 – Full speed HID Class USB to UART/I2C Datasheet section 5.1 Device Interface Configuration. DCNF0 and DCNF1 are configured on hardware.
Ensure you have I2C enabled and are opening the correct interface number.

IO_ERROR may also be a hardware issue. I would advise test, evaluation and reference using the UMFT260EV1A if you are already using custom hardware.

Also refer to the examples provided with LibFT260.

The other alternative is not to use LiBFT260 and access the device with raw HID commands. See AN_394 User Guide for FT260.

Best Regards,
FTDI Community
Logged