Com Trouble. Need help ASAP. Please…

Are you running a single thread or multiple threads?

Larger devices have larger UART RX/TX internal buffers so things would run smoother.

There is an event for UART error so you can easily detect a data overrun condition.

Gus:

Do know if the Debug.Print facility only allows one thread to output at a time?

I was thinking there might be two threads writing to Debug.Print at the same time ,and the problem is the output is mangled… not the data…

I am not sure but Debug.Print is too slow and should only used for debugging

Hi mike
I am running 4 threads two COMs, one for SD card, one for display and input buttons.
At the moment only one COM thread has the Debug.Print enable.

Thanks
Niarn

Try to optimise the other threads (use a sleep in while loop or wait for manualresetevent like I showed in one of my previous posts) and remove the debug.print.

Add some code that only prints when an error is detected. Maybe its just the debug channel that can’t follow…

By the way, in your last code: the com thread will exit when bytestoread is zero.