With CDC, you have no control over how many bytes are received at a time. That depends on the operating system of the PC.
You may get 3 bytes, or you may only get 1, you have to account for the number of bytes received.
Your belief that USBIN is writing characters that it didn't receive, is completely incorrect.
Those characters are already in the buffer array.
If you clear the array before doing the USBIN you will see the difference.
Read Post #2 again, which will fix your sample code.






Bookmarks