PL2303TA (USB to Serial Bridge Controller) Serial Port Speed at 3Mbps (C#)

212 Views Asked by At

I'm try reading data from COM port. i used PL2303TA Convertor that increases data transfer speed. my data transfer speed is 3Mpbs and I'm looking for sample to read data at this Speed. i wrote a program by C# and use "while" loop to read receiving data. but some data has been lost.

int _max = 50000; // max sample
SerialPort port = new SerialPort("COM4",
      3000000, Parity.None, 8, StopBits.One);
port.Open();
List<string> slist = new List<string>();
while(true)
{
   string sdata = port.ReadLine();
   slist.Add(sdata);
   if (slist.Count > _max)
      break;
}

my device sending data sequence like this:

 1,2,3,...,7000,1,2,3...,7000,1,2,3

and by this code i receive data like this:

 1,3,5,...,6999,1,3,5,...,6999,1,3,5

(my device is "ARM Micro-controller AT91SAM7S64-AU" and send each number by newline Character: "\n" )

how can i improve reading speed?

thanks.

PL2303TA USB to Serial Bridge Controller http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=153&pcid=41

1

There are 1 best solutions below

1
Michael H. On

This sounds not like a software problem but a hardware one. Please make sure that the wires of the uart are as close as possible when using such high speeds.

Another option would be to use twisted and shielded wires when the interferences are still too high.

If you have a scope, please check the signal edges. I assume they do not have a clean rectangular shape anymore. I don't know the chip or the board in particular, but some boards also support something called oversampling. If you have noise on the signal, this may help sampling the serial signal as it samples multiple times on a single bit and uses an average to determine the single bit states.