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: Issue with FT260Q-T and LibFT260.dll when communicating in UART mode  (Read 10997 times)

aaron.needles@ymail.com

  • Newbie
  • *
  • Posts: 2
    • View Profile

Hi,

I am using the FT260Q-T on a new product design and am running into issues. We have designed the part into a custom circuit board and are using it for serial communications with a microcontroller via UART at 115200 baud.  We are communicating with the FT260 over the USB link and are able to successfully transfer packets between our app on a Windows 10 computer and run packet traffic in both directions indefinitely without issues. However, if the successive return packets contains a changing variable, then we are getting exceptions from the LibFT260.dll and our app crashes. There seem to be certain combination of bytes that cause an issue with the DLL. When this occurs we need to disconnect and reconnect the USB (therefore resetting power on the FT260) before we are able to communicate with it again. On the circuit board, and oscilloscope shows well-formed packets in both directions, so we don't see issues on the UART side as far as signaling is concerned.

Have you seen anything like this fault? Can you think of why it may be occurring and only for certain combinations of bytes where otherwise it is 100% successful?

Thanks,
     Aaron

-----------------
Aaron Needles 
Embedded Systems Consultant 
530-220-2547 
aaron.needles@ymail.com
www.NeedlesInnovation.com
Logged

aaron.needles@ymail.com

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Issue with FT260Q-T and LibFT260.dll when communicating in UART mode
« Reply #1 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
« Last Edit: September 04, 2022, 10:39:40 PM by aaron.needles@ymail.com »
Logged