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

I can't read the SBUF. The local variable don't receive the value of the SBUF. Thank you very much f

void getSBUF() interrupt 4 using 1
{
 char  temp = 1;

 temp = SBUF;
 RI = 0;
}

Parents

  • Can you be more specific? Code like that you posted works for me.

    "SBUF" is just a conventional name for a declaration like "sfr SBUF = 0x99". So the assignment statement is pretty much just an instruction to copy one internal RAM location to another.

    The variable temp won't survive return from the function getSBUF, since it's delcared local. Where are you checking the value to know that it's not the correct one?

Reply

  • Can you be more specific? Code like that you posted works for me.

    "SBUF" is just a conventional name for a declaration like "sfr SBUF = 0x99". So the assignment statement is pretty much just an instruction to copy one internal RAM location to another.

    The variable temp won't survive return from the function getSBUF, since it's delcared local. Where are you checking the value to know that it's not the correct one?

Children
No data