SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By Cannibal
#149594
Hi there,

I'm working on a project right now where I have a serial data stream at around 4-6 kB/sec from sensors that are put in a wrapper with a checksum on it inside a micro-controller, then sent over serial to be logged somewhere.

Right now I am using a prolific USB to serial cable and find that under both windows and linux I am getting intermittent data loss at both 115200 as well as the slower 57600.

I have checksums in the wrappers so I can detect these errors, but I am disturbed by their frequency. Under windows it is impossible to get good data, while under linux there's roughly one error per minute. Still much too high.

Does anyone have experience with different versions of RS232 to USB cables/chips and whether or not the drivers for FTDI are better than this showing from prolific?

Thanks in advance.

-Cannibal
By Cannibal
#149633
I don't have hardware flow control on the send side, but watching the CTS line on the PC side shows it's not signalling full.

Regarding dropping bytes on the send side, it's a very simple buffer scheme, so while it's not foolproof, an off by 1 error would show up very frequently, whereas this error can crop up in clusters or not for 15 minutes of streaming. If it was an error on the send side, I'd expect to lose data more consistently - if data loss can be considered consistent.
By fll-freak
#149635
I had a discussion at lunch (I will send you the bill...) about this issue. Other engineers have seen this problem with USB to serial converters. It would appear the buffers in the converter are not particularly deep. Loss of data is not unheard of. Some had experienced loss data that matched very specific data patterns as if the sequence was a command to the converter. Sending large chunks of binary data could be problematic if the pattern was in the data.

They also have problems with latency. If you send a single byte, it may be a while before the converter times out and puts the single byte into a USB packet to ship out. They are mostly using the Prolific drivers.

Now I tend to buy converters based on the FTDI chipset as these have inherent driver support in Windows. Not sure I have ever seen data loss with an FTDI, but I was not looking for one either.

Edit for grammar.
Last edited by fll-freak on Tue Sep 25, 2012 5:49 am, edited 1 time in total.
By winston
#149803
My memory is a bit fuzzy since it was a few years ago, but I had endless trouble with a USB-serial converter for retail POS equipment (driving a typical retail receipt printer). Under Windows, basically there appeared to be a serious bug in the flow control code in Windows which meant while it paid attention to the hardware flow control, it would basically keep sending a bit more data before stopping and overflow the device's buffer and lose data. (There was no such problem under Linux, which worked correctly in this respect). This was under XP, the situation may have improved since then and it may have been the vendor's drivers rather than a problem with Windows itself.

I'd also like to recommend FDTI based devices. They just work.