win32 - High speed serial streaming code???



I need to capture data from a serial device that has 115200bps output. Its
continously outputs 3byte packets 1250 times per second.

I have tried using the win standard way to do serial port access (CreateFile
ReadFile etc.) and cannot obtain anywhere near 3750 bytes per second. The
system is completely dropping some data.

The 3rd byte in every packet is 0xFF and the packets can have no break in
time between the 3rd byte of one and the first of the next. I am not sure if
0xFF is affecting anything. Alot of the packets are: 0x00 0x00 0xFF, so im
not sure if this is cuasing the problem either.

I have tried use setupcomm to give massive buffers (30KB etc.) and can't get
close to 3750 bytes per second
..
With ReadFile how many bytes should I be reading? If I put 3 I can get about
100 packets per second. If I put 1000bytes I get about 200 packets per
second...

I am using visual c++

I know it is not a CPU performance thing because this is a 3GHz P4 and the
CPU usuage is zero all the time.

Is there some other way to low level access the uart chip so I can stream in
this data fully? I cannot understand why modern computer cannot continously
stream and save data at 115200bps.

I have also tried event based triggering and the performance is just as bad.


.



Relevant Pages

  • Re: win32 - High speed serial streaming code???
    ... > continously outputs 3byte packets 1250 times per second. ... > stream and save data at 115200bps. ... and by the time you look for more data the buffer has overflowed. ...
    (comp.programming)
  • Broken TCP/IP packets
    ... I have a serial device that is using MCU's UART for data ... it a single transaction. ... packets are broken in parts. ... UART signal via oscilloscope but the timing was quite consistent. ...
    (microsoft.public.win32.programmer.networks)
  • Broken TCP/IP packets
    ... I have a serial device that is using MCU's UART for data ... it a single transaction. ... packets are broken in parts. ... UART signal via oscilloscope but the timing was quite consistent. ...
    (comp.arch.embedded)
  • Re: VOIP Softphone
    ... The application receives a data stream off the network. ... spaced out every 50 milliseconds which equates to 800 bytes of audio data. ... in my application by either dropping packets if they are to late, ...
    (microsoft.public.win32.programmer.mmedia)
  • Re: read() returns ETIMEDOUT on steady TCP connection
    ... I'am also meet this problem in my mss server(missey streaming server). ... What is unusual is that this is happening right in the middle of sending a steady stream of data with no network congestion. ... The likelihood of this happening seems to increase as the number of audience connections increases. ... all packets received are delivered to the upper layer. ...
    (freebsd-net)