SerialPortStream is an independent implementation of System.IO.Ports.SerialPort and SerialStream for better reliability and maintainability. Default branch is 2.x and now has support for Mono with help of a C library.
I'm trying to improve my download speed from an FTDI FT232H (Hi-speed USB) running at 4 Mbaud using the FTDI VCP driver v2.12.28.0 (Windows 7 x64). Each data packet (about 2900 bytes) has a total ~40 ms turnaround time on a PIC24 (process command, read SD card, prepare response, send out UART to FT232H, wait for next request from PC). There's about a 10 ms delay from when the last USB data frame is sent to when the PC sends its next command.
I tracked down this delay to the line 222 in CommOverlappedIo.cs:
// Time out if data hasn't arrived in 10ms, or if the read takes longer than 100ms in total
timeouts.ReadIntervalTimeout = 10;
timeouts.ReadTotalTimeoutConstant = 100;
timeouts.ReadTotalTimeoutMultiplier = 0;
Is there a particular reason a 10 ms timeout was chosen? I was able to reduce this timeout to 1 ms which improved my download time by about 25%. It would be nice if this timeout could be configured from my application rather than modifying the library source.
As a side note, I tried disabling the PL2303_WORKAROUNDS to use "non-asychronous behavior" but then I started getting CE_OVERRUN errors after the first 10 or so data packets. The only recommended solutions I've found are to reduce my baud rate, or read the data out of the serial port buffer faster.
I'm trying to improve my download speed from an FTDI FT232H (Hi-speed USB) running at 4 Mbaud using the FTDI VCP driver v2.12.28.0 (Windows 7 x64). Each data packet (about 2900 bytes) has a total ~40 ms turnaround time on a PIC24 (process command, read SD card, prepare response, send out UART to FT232H, wait for next request from PC). There's about a 10 ms delay from when the last USB data frame is sent to when the PC sends its next command.
I tracked down this delay to the line 222 in CommOverlappedIo.cs:
Is there a particular reason a 10 ms timeout was chosen? I was able to reduce this timeout to 1 ms which improved my download time by about 25%. It would be nice if this timeout could be configured from my application rather than modifying the library source.
As a side note, I tried disabling the PL2303_WORKAROUNDS to use "non-asychronous behavior" but then I started getting CE_OVERRUN errors after the first 10 or so data packets. The only recommended solutions I've found are to reduce my baud rate, or read the data out of the serial port buffer faster.