Serial data is not receiving by 8051 microcontroller

Discussion in 'Embedded Systems and Microcontrollers' started by lohithraghuram, Aug 3, 2013.

  1. lohithraghuram

    Thread Starter New Member

    Aug 2, 2013
    3
    0
    Hi friends, i am new to this forum, i have encountered a problem, i want to send the serial data from PC to 8051 micro controller through serial port and hyper terminal software, but the data is not receiving by micro controller. I want to display the character on 16 x 2 LCD display. RI is not setting to 1 and the routine what i written to receive and display the character is not executing. I am using Flash magic software to dump the code into micro controller and it is going properly.

    Since one week i am facing this problem, earlier it worked properly(data displayed on LCD). I attached my code and circuit diagram, so please suggest me what to do.
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,177
    1,799
    Don't you need to set the REN (Receiver ENable) bit in SCON?
     
  3. lohithraghuram

    Thread Starter New Member

    Aug 2, 2013
    3
    0
    Thanks for your reply. I set the bit REN bit in SCON reg, that's why i put the scon value as 0x50(10010000). last two bits 1 0 are for mode 2, and the next 1 is for REN. I always set the bit REN to 1. Is this correct sir, please suggest me what to do.
     
  4. Arm_n_Legs

    Active Member

    Mar 7, 2007
    183
    10
    From your circuit, it shows a 12 MHz crystal being used. I supposed you are programming for 9600 bps. However, using a 12 MHz crystal, you will have a 8% error on the baud rate. I am not sure if this is the cause of your non reception. You can try changing the crystal to 11.0592 MHz which will give a more accurate 9600 bps.

    Alternatively, you can lower the baud rate to 2400 bps using the 12 MHz crystal. 12 MHz can produce a baud rate of 2404 bps. The error reduces to 0.2%.
     
  5. lohithraghuram

    Thread Starter New Member

    Aug 2, 2013
    3
    0
    Thanks for your reply, i will try with 11.0592 crystal...
     
Loading...