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

problem in reading SBUF

my first Q is, while simulating in KEIL does it not able to read the SBUF.
when i am simulating the program and i make RI high then it goes to the intrupet and then put SBUF= any value like SBUF='s'
and then the cursor goes to my reading line
i.e var=SBUF; but after this there is no value in var and one more thing if the var has some value before var=SBUF;
it goes zero all gone .
so now i am doubting keil simulator.
but my transmit part is working fine.

Parents
  • so now i am doubting keil simulator.

    There's no reason to. From what you describe, the simulator is working exactly as it should be. You need to refer to the 8051 hardware documentation for the exact explanation.

    SBUF does _not_ act like a regular register. You cannot read a value back from it. If you read from SBUF, you will read the last value received by the UART (if any), not the last value you wrote to SBUF.

Reply
  • so now i am doubting keil simulator.

    There's no reason to. From what you describe, the simulator is working exactly as it should be. You need to refer to the 8051 hardware documentation for the exact explanation.

    SBUF does _not_ act like a regular register. You cannot read a value back from it. If you read from SBUF, you will read the last value received by the UART (if any), not the last value you wrote to SBUF.

Children