FTDI Community

General Category => General Discussion => Topic started by: ol_devel on July 24, 2020, 08:03:16 AM

Title: FT_SetEventNotification - Thread block
Post by: ol_devel on July 24, 2020, 08:03:16 AM
My post relates to my use of the FTDI FT2XXX USB-Serial parts. I have used these in numerous designs, the latest of which requires communication with a Windows application (Qt - C++). Low latency is critical (2ms), and although I believe a timer-based polling mechanism can be used, I'd prefer to use an asynchronous mechanism if at all possible.

In paragraph 3.28 (FT_SetEventNotification) of version 1.4 of the D2XX Programmers Guide, the following is offered.

"An application can use this function to setup conditions which allow a thread to block until one of the conditions is met. Typically, an application will create an event, call this function, then block on the event. When the conditions are met, the event is set, and the application thread unblocked."

This leads to my question. Does this mean that I would require a thread dedicated to the receipt of data, and thus handle data transmission on a separate thread?

Your shedding more light on this will be greatly appreciated.
Title: Re: FT_SetEventNotification - Thread block
Post by: FTDI Community on July 24, 2020, 04:40:33 PM
Hello,

There are software examples provided in the D2XX Programmer's Guide (https://www.ftdichip.com/Support/Documents/ProgramGuides/D2XX_Programmer's_Guide(FT_000071).pdf) for FT_SetEventNotification.

Have you also reduced the latency timer?
Note that the minimum latency timer for full speed USB devices is 2ms, and for High Speed USB devices is 1ms.
The default latency timer is 16ms.
The easiest method to use would be through the D2XX Drivers using:
FT_SetLatencyTimer
The application code would need to set this each time it’s executed.

Best Regards,
FTDI Community
Title: Re: FT_SetEventNotification - Thread block
Post by: ol_devel on January 13, 2021, 07:41:30 AM
Thank you for your reply.