1
Discussion - Drivers / Re: Issue with FT260Q-T and LibFT260.dll when communicating in UART mode
« on: September 04, 2022, 10:37:43 PM »
Ok, I found the problem that led to the Exception. The FT260Q-T appears to have flow control enabled by default. With this enabled, a binary 10-byte packet coming into the UART RX pin is transferred by the FT260 over USB to the PC and in the occasional case that a 0x13 appears in the packet, this causes an exception the next time FT260_UART_Write() is called from the application. This appears to be related to the fact that flow control is enabled and that the DLL code appears to be aware of this and raises an exception which comes in as unhandled exception into the C# code that is using the library. I insert the following call at initialization and the exception is no longer occurring.
private static IntPtr ft260handle = new IntPtr();
private static FT260_STATUS Status = 0;
...
Status = FT260_OpenByVidPid(0x0403, 0x6030, 0, ref ft260handle);
...
Status = FT260_UART_Init(ft260handle);
...
Status = FT260_UART_SetFlowControl(ft260handle, FT260_UART_Mode.FT260_UART_NO_FLOW_CTRL_MODE);
I haven't done much testing yet, but for now the main issue has been resolved.
-Aaron
private static IntPtr ft260handle = new IntPtr();
private static FT260_STATUS Status = 0;
...
Status = FT260_OpenByVidPid(0x0403, 0x6030, 0, ref ft260handle);
...
Status = FT260_UART_Init(ft260handle);
...
Status = FT260_UART_SetFlowControl(ft260handle, FT260_UART_Mode.FT260_UART_NO_FLOW_CTRL_MODE);
I haven't done much testing yet, but for now the main issue has been resolved.
-Aaron