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 / LCD interfacing with AT89S52

LCD interfacing with AT89S52

|

Microcontroller › 8051 › LCD interfacing with AT89S52

  • This topic has 2 replies, 3 voices, and was last updated 8 years, 1 month ago by Ashutosh Bhatt.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • April 9, 2017 at 9:29 am #4638
    RANJEET
    Participant

    I wirte code for LCD interfacing with AT89S52. It's showing characters on display but  the problem is 'each character is repeated 3 times'. my code is given below

    #include<reg52.h>
    #define ldata P1
    sbit rs=P2^2;
    sbit rw=P2^1;
    sbit en=P2^0;
     
    void delay();
    void lcdcmd();
    void lcddat();
     
    void delay(unsigned int value)
    {
    unsigned int i,j;
    for(j=0;j<1275;j++)
    {
    for(i=0;i<value;i++);
    }
    }
    void lcdcmd(unsigned char cmd)
    {
    ldata=cmd;
    rs=0;
    rw=0;
    en=1;
    delay(10);
    en=0;
    return;
    }
    void lcddat(unsigned char dat)
    {
    ldata=dat;
    rs=1;
    rw=0;
    en=1;
    delay(10);
    en=0;
    return;
    }
     
    void main()
    {
    lcdcmd(0x38);
    delay(50);
    lcdcmd(0x0E);
    delay(50);
    lcdcmd(0x01);
    delay(50);
    lcdcmd(0x06);
    delay(50);
    lcdcmd(0x86);
    delay(50);
     
    lcddat('R');
    lcddat('A');
    lcddat('K');
     
    }
     
    April 20, 2017 at 4:26 am #14568
    Hari Prasaath K
    Participant

    Look at the link for tutorial, you will get the solution

    https://www.engineersgarage.com/microcontroller/8051projects/display-text-LCD-AT89C51-circuit

    April 20, 2017 at 11:41 am #14569
    Ashutosh Bhatt
    Participant

    you have not given enough delay before sending data or command to LCD

    pls refer other LCD interfacing programs

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

RSS Recent Posts

  • Failure of polypropylene motor-run capacitors June 16, 2025
  • Siemens large industrial PLC parts June 16, 2025
  • Wideband matching an electrically short bowtie antenna; 50 ohm, 434 MHz June 16, 2025
  • Curved lines in PCB design June 16, 2025
  • using a RTC in SF basic June 15, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 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