FTDI Community

General Category => Discussion - Drivers => Topic started by: seo on March 29, 2021, 09:35:08 AM

Title: FT_SetFlowControl: configuring flow control before entering MPSSE mode
Post by: seo on March 29, 2021, 09:35:08 AM
Hello,

FTDI Application Note 108 "Command Processor for MPSSE and MCU Host Bus Emulation Modes" suggests the following: "NOTE: To ensure that the device driver will not issue IN requests if the buffer is unable to accept data, add a call to FT_SetFlowControl prior to entering MPSSE or MCU Host Bus modes."

FTDI Application Note 135 "FTDI MPSSE Basics" gives the following wording: "FT_SetFlowControl – Configure for RTS/CTS flow control to ensure that the driver will not issue IN requests if the buffer is unable to accept data."
The code suggested by Application Note 135 is as follows:
FT_SetFlowControl(ftHandle, FT_FLOW_RTS_CTS, 0x00, 0x00); //Turn on flow control to synchronize IN requests

Could you please explain the rationale behind it? Why should we configure for RTS/CTS flow control before entering MPSSE mode? As far as I understand in MPSSE mode there are no pins that would act as RTS and CTS (in the sense as RTS/CTS pins are used e.g. in UART mode).

Thank you in advance!
Title: Re: FT_SetFlowControl: configuring flow control before entering MPSSE mode
Post by: FTDI Community on March 29, 2021, 11:46:19 AM
Hello,

We recommend to enable the RTS_CTS flow control when using MPSSE, you can do this when configuring the device after opening the port and before entering MPSSE mode.

As you mentioned, there are no RTS or CTS lines on the device in this mode and so using RTS/CTS mode in MPSSE does not require any special connections or signals.

But enabling RTS/CTS mode also enables the flow control features in the driver itself, and so the driver wont try to read data from the chip if it does not have room for the data. Without flow control enabled, this data would otherwise have been lost. You may see the MPSSE wait until space is available if the driver buffer fills and the driver stops taking data over USB and the chip buffer then fills.

Best Regards, FTDI Community
Title: Re: FT_SetFlowControl: configuring flow control before entering MPSSE mode
Post by: seo on March 30, 2021, 10:46:17 AM
Thank you for your explanation!
Title: Re: FT_SetFlowControl: configuring flow control before entering MPSSE mode
Post by: cioma on April 25, 2021, 05:24:07 PM
So if we don't use FTDI drivers then there is no need for us to enable RTS_CTS flow control when using MPSSE, correct?