This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Inputing data through Serial Window is slow

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!

Parents
  • Here:

    while (RI==0);
    But it would be a whole lot easier to see if the OP took the trouble to properly lay out the code!

    And a few comments wouldn't go amiss; eg,

    while (RI==0); // Wait until RI is set

    I missed that one because I (once? still?) work(ed) with a debugger that would not set a breakpount on

    while();
    

    but would set one on

    while()
    {
    }
    

    and thus since have 'outlawed' while();

    anyhow, the second form is a lot clearer

    of course, had the OP bothered to comment I would not have missed it.

    Erik

Reply
  • Here:

    while (RI==0);
    But it would be a whole lot easier to see if the OP took the trouble to properly lay out the code!

    And a few comments wouldn't go amiss; eg,

    while (RI==0); // Wait until RI is set

    I missed that one because I (once? still?) work(ed) with a debugger that would not set a breakpount on

    while();
    

    but would set one on

    while()
    {
    }
    

    and thus since have 'outlawed' while();

    anyhow, the second form is a lot clearer

    of course, had the OP bothered to comment I would not have missed it.

    Erik

Children