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??????????
But what code do you use to wait until there is a character available, before reading from SBUF?
If you reach with your hand into an empty postal office box to try to get any mails, you will fail to pick up the mails if no mails have arrived...
@ Per Westermark
thnx my problem is solved
Hey, Please tell me how you solved this problem??????
View all questions in Keil forum