Search code examples
serial-portusbuartftdi

Delay in between uart packets sent from another device to PC using FTDI chip


I have a device sending a series of 20 byte UART frames ( 20 bytes each without delay in between the 20 bytes).By sending data from device to PC Using FTDI chip TTL to USB convertor , there is a delay of 16 ms in between the 20 bytes sometimes.Why is it so?

This was monitored on - Look RS232 software

When observed on a monitoring software in PC there is a delay of 16ms -in between the 20 bytes in some of the frames. eg 4 bytes first then 16 and so on.Or 6 bytes first then the rest 10 after 16 ms. It has been tried with different baud rates.The same issue persists.

I read that there is a latency timeout in FTDI chip if minimum 64 bytes are not received and this latency is 16ms. But this should not affect my application since the maximum length at which data is sent continuously is 20 bytes after which there is a delay and then the next 20 byte arrives. So as soon as the 20 bytes are received then time out should occur. There should not be a delay in between. Reference: https://www.ftdichip.com/Support/Documents/AppNotes/AN_107_AdvancedDriverOptions_AN_000073.pdf

Could this be due to USB scheduling delay and the fact that it it not exactly interrupt driven? does anybody have a possible solution for this? the delay is always 16 ms.

Expected result is 20 bytes data without delay in between.


Solution

  • Without delay will be impossible. As we are talking about USB there is always some jitter due to the nature of USB and most bus systems in general. The latency/timeout setting of the FT driver is typically set to 16 ms. You can change that under windows in the device manager via the settings dialog of the corresponding virtual com port. Best I could get with a FT2232H with baud rate beyond 10 MBps is 1.46+-0.31 ms (n=1000 packages) for packets traveling back and forth.