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

cannot read/store my SBUF value received

Sir, I am having trouble in saving the data received from the rxd of 89c52. when i debug the program and i checked the values and changed the SBUF value and on further checking the values of the temp=SBUF the temp value is still on 0.

unsigned char temp;
void serial_read()      // read byte
{
        while(RI==0);
        temp=SBUF;
        RI=0;
}

and there is a doubt that if we return the SBUF value this is not working.

unsigned char serial_read()
{
 while(RI==0);
 return SBUF;
}

Thanks in advance.

Parents
  • Bradford
    Thank you sir, that helped me a lot. Actually we are testing it directly with a RF module (315/434 MHz transmitter and receiver) on two separate circuits. And using 89c52 serial communication ports to send data through transmitter (in P3^1) and receive data via receiver (in P3^0).
    I think the problem is with the baud rates since this module is capable for 300 baudrate operation. And i am using 9600 baudrate.

Reply
  • Bradford
    Thank you sir, that helped me a lot. Actually we are testing it directly with a RF module (315/434 MHz transmitter and receiver) on two separate circuits. And using 89c52 serial communication ports to send data through transmitter (in P3^1) and receive data via receiver (in P3^0).
    I think the problem is with the baud rates since this module is capable for 300 baudrate operation. And i am using 9600 baudrate.

Children
  • I think the problem is with the baud rates since this module is capable for 300 baudrate operation. And i am using 9600 baudrate.

    you should not dont think so, you should know so

    is 300bps REALLY all the module can handle

    why do you think a module only capable of 300 bps will get any information out of data sent at 9600?

    Erik