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: FT260 - Pauses in I2C comunication.  (Read 15863 times)

HI_type

  • Newbie
  • *
  • Posts: 15
    • View Profile
FT260 - Pauses in I2C comunication.
« on: July 27, 2021, 09:41:43 AM »

Hello

Hope this is the right place to ask.

Problem: Using LibFT260 (form here: https://ftdichip.com/products/ft260q/) we can successfully read from our slave device, but at an effective speed lower than the clock speed would allow. The issue is pauses in between frames:

X -> Byte + ACK
_ -> Clock held low by FT260 (Pause)

XX_X_X_X_X....

See attached images. The slave device is not clock stretching as it has a weak driver and it is clearly visible by the low level of the clock when that happens. The duration of the pause at 2Mbit clock is shorter than at 400kbit.

The pauses occur during read and write.

Questions:
- Is the FT260 capable of communicating without these pauses?
- If so, how, and can it be done with the dll provided in LibFT260?

Our software Engineer has provided c++ pseudo code to illustrate what he is doing:

##############################################################
FT260_HANDLE FFT260Handle;
FT260_STATUS status;
...
uint32 kbps = 400;
int dwBytesToWrite = 7;
uint8 writeBuffer[dwBytesToWrite] = (0x01, 0x81, 0x80, 0x00, 0x00, 0xA0, 0x15);
DWORD dwBytesToRead = 14;
uint8 deviceAddress = 0x60;
uint8 readBuffer[dwBytesToRead];
DWORD dwBytesReturned;
...
    status = FT260_I2CMaster_Init(FFT260Handle, kbps);
    if (status== FT260_OK)
    {
       status= FT260_I2CMaster_Write(FFT260Handle, deviceAddress,
          FT260_I2C_START, writeBuffer, dwBytesToWrite, dwBytesWritten);
       if (status== FT260_OK)
       {
           status= FT260_I2CMaster_Read(FFT260Handle, deviceAddress,
              FT260_I2C_START_AND_STOP, readBuffer, dwBytesToRead, dwBytesReturned);     
       }
...   
    }
##############################################################
Logged

HI_type

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: FT260 - Pauses in I2C comunication.
« Reply #1 on: August 04, 2021, 07:49:38 AM »

So, nobody has seen the FT260 communicate without those pauses? Is this a chip design issue?
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 891
    • View Profile
Re: FT260 - Pauses in I2C comunication.
« Reply #2 on: August 04, 2021, 10:29:57 AM »

Hi,

We can try this out to see if we can see the same thing,

What timebase was your scope on and so what kind of pause duration were you seeing in each case?

One thing to note is that the FT260 uses interrupt transfers which support 64Kbytes/sec (for each IN or out pipe) and so the throughput will be limited by this, this may be one factor in the delay you see. 

Best Regards, FTDI Community
Logged

HI_type

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: FT260 - Pauses in I2C comunication.
« Reply #3 on: August 04, 2021, 11:37:57 AM »

Hello and thank you for the support :)

The time base in the 400 kBit case was 10us/div, the cursors measure the pause to be approximately 28.4us.

The pause in the 2 Mbit test is shorter: 3.8 us.
Logged

HI_type

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: FT260 - Pauses in I2C comunication.
« Reply #4 on: August 12, 2021, 11:26:18 AM »

Hello FTDI Community

Any updates on the issue? Shall I open a service ticket somewhere?
Logged

allenhuffman

  • Newbie
  • *
  • Posts: 48
  • Mostly harmless.
    • View Profile
    • Sub-Etha Software
Re: FT260 - Pauses in I2C comunication.
« Reply #5 on: August 26, 2021, 08:28:50 PM »

This may not help, but...

Using the FT4222, we noticed timing gaps between groups of data (I seem to recall odd spacing every 3 bytes).

Somewhere (support? random internet searching?) we were told to look at the SetClock speed and set it to SYS_CLK_24.

FT4222_SetClock (ftHandle, clock);

I do not know if this changed anything.
Logged

HI_type

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: FT260 - Pauses in I2C comunication.
« Reply #6 on: August 31, 2021, 06:19:57 AM »

Thank you allenhuffman

I will forward this information to our software engineer and see if he is willing to have a look.

Hopes are still to get a confirmation from somebody that this chip actually can run at 3,4Mbits actual throughput. An alternative could be the FT201X https://www.ftdichip.com/old2020/Support/Documents/DataSheets/ICs/DS_FT201X.pdf but it requires drivers, not a show stopper, but the lesser choice.

Thank you again for the input.
Logged

HI_type

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: FT260 - Pauses in I2C comunication.
« Reply #7 on: August 31, 2021, 08:10:28 AM »

OK, i talked to our software engineer again and he had news: He used a USB package analyzer to see what the LibFT260.dll is sending and proclaims he would not be able to optimize this.

At the same time, the maximal transfer speed for HDI seems indeed to be 64kbit/s. This appears to be a hard limit. Going beyond this limit would again require a custom driver, defeating the point. Unfortunately, the FT260 is deemed unfit for our use case as we need an actual transfer rate of around 2Mbit/s.

Maybe FTDI would like to point this out explicitly in the datasheet? We have also seen the pause when sending a full set 64bits, effectively making a burst meant to be 2Mbit/s to be closer to 1Mbit/s.

Thank you for the support to everybody involved.
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 891
    • View Profile
Re: FT260 - Pauses in I2C comunication.
« Reply #8 on: August 31, 2021, 09:56:43 AM »

Hello,

Thanks for your updates and for your inputs too Allen,

Yes unfortunately the USB transfers are limited to 64K on the interrupt endpoints and so although the device can run at 12Mbaud and 3.4M I2C, the actual throughput will not match these.

We specify this on page 12 of the datasheet but it is in amongst the text and is also not directly referring to the baud and I2C rates. We can look at improving the datasheet to make sure that this limitation is clear and stated explicitly as you suggested,

Sorry to hear the FT260 is not suitable. The FT260 is ideal for many uses as it uses HID class but the throughput is limited by this. We have other hi-speed USB devices which use bulk transfers such as the FT4222H which might be an option for you,
Bulk transfers don't offer guaranteed bandwidth at any instant as the bandwidth is shared with other devices and so can depend what other devices you have connected to the PC, but the overall bandwidth is usually much higher than this 64K interrupt transfer on the FT260.

Best Regards, FTDI Community











Logged

HI_type

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: FT260 - Pauses in I2C comunication.
« Reply #9 on: August 31, 2021, 10:06:06 AM »

Thank you FTDI community

I would be looking at the FT201X as we are constraint with space. Do you see any issues with that device regarding speed?

In our setup, this device will be only one in use when it is accessed. Thank you for the heads up.
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 891
    • View Profile
Re: FT260 - Pauses in I2C comunication.
« Reply #10 on: August 31, 2021, 11:11:39 AM »

Hi,

The FT200XD and FT201X are only I2C slaves and cannot act as a host to a sensor etc. and so if you need the FTDI device to be a master, I'm afraid this isn't suitable.

FT4222H or FT232H would be possible options,

The FT232H MPSSE is more generic and so needs to talk back to the PC for each byte so your code can check ack/nak and so if you need to check these per byte before proceeding to the next, and so the rate might not be enough unless you can do a burst without checking ack/nak (for write) or deciding ack/nak (for read) in real time.

The FT4222H might be the fastest device if you need to determine or check ack/nak in real time or features like clock stretch etc.

Best Regards, FTDI Community

Logged

HI_type

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: FT260 - Pauses in I2C comunication.
« Reply #11 on: August 31, 2021, 11:59:34 AM »

Thank you for the clarification FTDI Comunity

I think the FT4222H is definelty the way to go. Never heard of quadSPI and interpreted the title as 4 x SPI or 4 x I2C, implying a lot of pins, large package. This is not the case and the package does fit the application. Will look into the FT4222H.
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 891
    • View Profile
Re: FT260 - Pauses in I2C comunication.
« Reply #12 on: August 31, 2021, 01:32:11 PM »

Hi,

Glad it helped,

Yes, the FT4222H offers one SPI Master (SCK/MOSI/MISO) with up to four chip selects,  or one Quad SPI (this uses four bi-directional data lines and is used by some devices such as flash chips or Bridgetek EVE chips) or one I2C Master or one SPI slave (MOSI/MISO/SCK).

It uses hi-speed USB and bulk transfers and so offers quite a lot more throughput,

Best Regards, FTDI Community

Logged