libftdi Archives
|
From: | Will Zhang <wilzzha@xxxxxxxxx> |
---|---|
To: | libftdi@xxxxxxxxxxxxxxxxxxxxxxx |
Date: | Tue, 24 Aug 2010 18:21:40 +1000 |
Hi, Take a look at this application note from FTDI, particularly part II. http://www.ftdichip.com/Support/Documents/AppNotes/AN232B-04_DataLatencyFlow.pdf FTDI recommends using hardware flow control/handshaking to prevent chip buffer overrun. This FAQ has info on how CTS/RTS work on FTDI chips. http://www.ftdichip.com/Support/FAQs.htm#HwGen3 However though, I think there's a bug with libftdi's flow control setting function. Here's what I know: My configuration involves an FT232R in UART mode connected to an FPGA. The FPGA has UART transmitter implemented in HDL with CTS input (which is connected to the RTS output on FT232R) as flow control option. Ideally, if the FPGA is sending data non-stop but meanwhile the PC cannot keep up with it's pace (USB driver is not scheduled frequent enough to move data from chip buffer to the PC), the chip buffer will fill up quickly and the RTS line will go high (RTS# is active low) to indicate buffer full. Then the FPGA UART Tx should stop transmitting data in order to prevent buffer overrun on the FT232R. The problem I've found is that many driver options did not set the flow control register in the FT232R chip correctly. I have experimented numerous driver options on the PC side, some worked, many didn't. Here's a list: These drivers are not working correctly, RTS line is constantly high, which is the behavior when flow control is set to NONE. - FTDI's D2XX library (binary release only) on Linux and Mac OS X - ftdi_sio VCP kernel module on Linux (This is the Linux VCP driver on FTDI's website) - libftdi on Linux and Mac OS X These drivers are working correctly, RTS is high when buffer is nearly full, low otherwise. - FTDI's VCP kernel extension (binary release only) for Mac OS X - FTDI's VCP driver (binary release only) for Windows I haven't tested D2XX DLL driver on Windows. Apparently, I'm not the first one to report this issue. This is an archived conversation that had described the same problem: http://developer.intra2net.com/mailarchive/html/libftdi/2009/msg00131.html Note that for all these drivers, the CTS/RTS flow control works fine in the other direction, FPGA -> FT232R in my case. Any suggestions? Should I report this to FTDI, Bill Ryder maybe? Cheers, Will 2010/8/24 Szőke Sándor - Alex <mail@xxxxxxxxxxxxxx> Hi! libftdi - see http://www.intra2net.com/en/developer/libftdi for details. |
Current Thread |
---|
|