I am writing a code that simulates receiving text from the serial port using the serial window. When I debug this code step by step and enter the text, it works fine, but when I run the code and enter the text all at once not all of the characters are received! For example if I want to enter "OK", in debugging step by step I enter O then K and it is perfect. However, when I run the code and type "OK" quickly, I may receive "K" only or nothing at all, while if I type it slowly (which I don't think is the case in serial communication) it is received correctly! Can you help me with this? Thank You!
Why should we - for now - ignore your code that tries to move a lot of data? Why are you not doing that incrementally? Every time you receive one character from the serial port, you can place that single character exactly where you need it to be. So no huge extra work when you see a carriage return.
By the way - why do you have a variable for your carriage return? What was wrong with just using a named constant?