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!
Just read my own post and noticed I mis-spelled Erik's name. Sorry about that Erik. Bradford
Thanks,I have already found it, and I really appreciate your help.
Is this on a test? Usually when several ask the same question we are answering a test question is that the cse? Erik
NO, our group is finishing a project involving programming 8051 for serial communication. And I have no idea about previous questions.
"our group is finishing a project involving programming 8051 for serial communication" Finishing?! - yet you're still stuck on fundamentals like this?!