EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / 16X2 LCD interface with AT89S52 problem

16X2 LCD interface with AT89S52 problem

|

Microcontroller › 8051 › 16X2 LCD interface with AT89S52 problem

  • This topic has 4 replies, 4 voices, and was last updated 13 years, 1 month ago by I am working as an R&D Er. in SparkLab. and interested to innovative research ..
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • January 19, 2013 at 11:51 am #2078
    prajwal
    Participant

    hello friends,

     

    I have interfaced LCD 16X2 with AT89S52 (11.0592MHz crystal)

     

    The code goes like this,

     

    #include<reg52.h>
    #define ldata P3
    sbit rs=P2^0;
    sbit rw=P2^1;
    sbit en=P2^2;
    sbit busy=P3^7;
    void lcdcmd(unsigned char value);
    void lcddata(unsigned char value);
    void MSDelay(unsigned int itime);
    void lcdready();
    void main()
    {
    lcdcmd(0x38);
    MSDelay(250);
    lcdcmd(0x0E);
    MSDelay(250);
    lcdcmd(0x01);
    MSDelay(250);
    lcdcmd(0x06);
    MSDelay(250);
    lcdcmd(0x86);
    MSDelay(250);
    lcddata(‘M’);
    lcddata(‘D’);
    lcddata(‘E’);
    }

    void lcdcmd(unsigned char value)
    {
    void lcdready();
    ldata=value;
    rs=0;
    rw=0;
    en=1;
    MSDelay(1);
    en=0;
    return;
    }

    void lcddata(unsigned char value)
    {
    void lcdready();
    ldata=value;
    rs=1;
    rw=0;
    en=1;
    MSDelay(1);
    en=0;
    return;
    }
    void lcdready()
    {
    busy=1;
    rs=0;
    rw=1;
    while(busy==1)
    {
    en=0;
    MSDelay(1);
    en=1;
    }
    return;
    }

    void MSDelay(unsigned int itime)
    {
    unsigned int i,j;
    for(i=0;i<itime;i++)
    for(j=0;j<1275;j++);
    }

     

    The problem is nothing is being displayed on LCD. Jus the backlight will be on.

     I have connected data pins of LCD to port P3 and control pins rs,rw&en to  rs=P2^0; rw=P2^1;en=P2^2;….

     

    Pls help……….. Thanks in advance

    January 21, 2013 at 6:25 am #9005
    nidhin.k
    Participant

    hai prajwal…

     

     

     

    ur code is working….

     

    reduse delay…

     

     

    void main()
    {
    lcdcmd(0x38);
    MSDelay(20);
    lcdcmd(0x0E);
    MSDelay(20);
    lcdcmd(0x01);
    MSDelay(20);
    lcdcmd(0x06);
    MSDelay(20);
    lcdcmd(0x86);
    MSDelay(20);
    lcddata(‘M’);
    MSDelay(20);
    lcddata(‘D’);
    MSDelay(20);
    lcddata(‘E’);
    MSDelay(20);
     
    }
     
     
     
    i checked it in proteus…. it’s working…
     
    all the best
    January 21, 2013 at 9:43 am #9012
    prajwal
    Participant

    Yeah it is working with me too :) There was some loose connection in hardware now its working fine.

    Thanks for your reply and concern :)

    April 23, 2013 at 9:18 am #9574
    RUBEN KURIAKOSE
    Participant

    Can you show me the circuit diagram used. I come with a similar problem.

    April 23, 2013 at 11:06 am #9577
    I am working as an R&D Er. in SparkLab. and interested to innovative research .
    Participant

    check your circuit conection………..

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Replacement IGBT for DGG4015 for Honda Motorcycle ECU June 14, 2026
  • Mitsubishi Electric IPM module lot code format - how to decode? June 14, 2026
  • TDK Lambda ESS 500-20-11-D-LB-RSTL Parallel Operation June 13, 2026
  • Programmable 1kV DC Power Supply – Budget ~$600 with Display June 13, 2026
  • effect of calibration on s-parameters June 13, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise