C# Serial Cominication is too slow - Need Help!

Hi Guys,

I try to read a lot of topics about C# with Arduino serial interferance, and I still can't figurte out how to read the data sent from my Arduino fast enough to plot a graph using C#.

  1. What I need: I need to read the data fast from C#, so I can plot a live graph.

  2. Problem: Arduino sends 20 reads from the sensor....my C# application received 5-6, so the chart does not have alot of points.

  3. What Code I'm using for C#:
    Tutorial : Arduino Interfacing with C# to read Temperature via LM35 sensor - YouTube

  4. Things that you should know:

  • I try increasing the baud rate from 9600 to a higher number and above code does not let me connect. So I cant use a higher baud rate...cant figurate out why.

-On C# I'm using a Timer of 10ms to read the serial. I know this could be the main problem. But I dont know what other way I can use to read fast enough...

Any help will be apreciated!

Thank You

On C# I'm using a Timer of 10ms to read the serial. I know this could be the main problem. But I dont know what other way I can use to read fast enough"

That is almost certainly your ENTIRE problem. Why would you use a timer AT ALL to read serial? Read it in your main thread, and check it on EVERY pass through the thread. Take the data AS IT ARRIVES, then process it when you've gathered a full message/buffer/whatever. The PC is more than capable of reading mutiiple channels of serial at 115K BAUD without even breaking a sweat.

If you want help with the code, POST the code, don't link to a site that contains a link to a site where we have to create an account to see the code. Some of us have better things to do with our time....

Regards,
Ray L.

Ray,

Sounds good! I will post my code as soon i get home. Thank you!!