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

Reading SBUF

unsigned char GetSerial =0;

SCON = 0x50; /* SCON: mode 1, 8-bit UART, enable rcvr */
TMOD = 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */
TH1 = 0xfd; /* TH1: reload value for 9600 baud */
TR1 = 1; /* TR1: timer 1 run */

GetSerial = SBUF;

the problem is when i add some data in serial window, and while running this command GetSerial = SBUF; , there is no data will copy from SBUF to GetSerial,

i see the watch-window.

so what is the problem??????????

Parents
  • Well..My Problem is while debugging in keil compiler I use serial window to make RI flag 1. And SBUF is set to some value suppose 0x3A; While debugging Rec_char is unable to copy the value of SBUF.
    elementary questions like this comes up almost daily.
    to avoid you asking something equally basic tomorrow I suggest you read "the '51 bible" where you will find the answer to this and your next questions.

    here is the link to "the bible"
    www.8052.com/.../120112

    Erik

Reply
  • Well..My Problem is while debugging in keil compiler I use serial window to make RI flag 1. And SBUF is set to some value suppose 0x3A; While debugging Rec_char is unable to copy the value of SBUF.
    elementary questions like this comes up almost daily.
    to avoid you asking something equally basic tomorrow I suggest you read "the '51 bible" where you will find the answer to this and your next questions.

    here is the link to "the bible"
    www.8052.com/.../120112

    Erik

Children