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

Why can't I read SBUF?

The code is like this:

#include <reg51.h>
void main()
{
unsigned char ch;
SBUF = 0xcc;
ch = SBUF ;
}

I found that the value in ch is always zero,however, when I substituated SBUF with other SFRs, the result in ch is 0xcc, which is correct. What is the problem here and how can I read the value in SBUF?

Thanks!

0