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

cannot read/store my SBUF value received

Sir, I am having trouble in saving the data received from the rxd of 89c52. when i debug the program and i checked the values and changed the SBUF value and on further checking the values of the temp=SBUF the temp value is still on 0.

unsigned char temp;
void serial_read()      // read byte
{
        while(RI==0);
        temp=SBUF;
        RI=0;
}

and there is a doubt that if we return the SBUF value this is not working.

unsigned char serial_read()
{
 while(RI==0);
 return SBUF;
}

Thanks in advance.

Parents Reply Children
  • I didnt know help forums like this asks people to "find a broom" when they dont get the answer.
    you got the answer from Per Westermark and two posts later you whined "why did I not get an answer" and I had to draw your attention to the answer from Per. If you can not understand the answer, there is none other, then you need go find a broom.

    Erik

  • ... in English, then please ignore my two posts. and, instead, go bu the rule "more words do not make you appear stupid, they make you appear clear"

    The (currenly) last post by you is clear and on a totally different subject to your original post so, if that is what you have tried to get help with why did you not post that clear statement before.

    Erik