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 / 16×2 LCD Skipping Alphabetic Letters (b,d,f,h,j etc.) – AT89C5131A

16×2 LCD Skipping Alphabetic Letters (b,d,f,h,j etc.) – AT89C5131A

|

Microcontroller › 8051 › 16×2 LCD Skipping Alphabetic Letters (b,d,f,h,j etc.) – AT89C5131A

  • This topic has 9 replies, 4 voices, and was last updated 12 years, 9 months ago by Syed Aameer.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • December 21, 2012 at 3:05 pm #2031
    guyd
    Participant

    Hello,

    I connected my lcd as directed in “How to display text on 16×2 LCD using 8051 microcontroller”.

    I used at89C5131A.

     

    The code is working properly, however there is one problem:

     

    For every 2nd alphabetic letter, it will skip to the next letter. that means if I write ABC it will show ACC

     

    A = A

    B = C

    C = C

    D = E

    E = E

    F = G

    G = G

    H = I

    I = I

    J = K

    K = K

    [space] = !

    : = ;

     

    and so on..

    Whats wrong with my LCD? Please help

     

    Thank you!

    December 21, 2012 at 6:05 pm #8865
    AJISH ALFRED
    Participant

    Interesting! I guess there is nothing wrong with the LCD. Could you please post the code which you are using.

    December 21, 2012 at 7:27 pm #8869
    guyd
    Participant

    Hey,

    Thanks for the reply, I managed to debug it, seems like port 2.0 did not change it value, so D0 on LCD was getting ‘1’ all the time.

     

    Thanks again for taking your time trying to help!

    December 21, 2012 at 8:50 pm #8870
    guyd
    Participant

    Well, in theory that is the problem…

    but for some reason, the problem still extist.

     

    the code:

     

     

    //Program to display String on LCD

    #include<reg52.h>

    #define lcd_data_pin P2

    sbit rs=P3^0; // Register select pin
    sbit rw=P3^1; // Read write pin
    sbit en=P3^2; // Enable pin
    void delay(unsigned int msec)    //delay function
    {
    int i,j;
    for(i=0;i<msec;i++)
    for(j=0;j<1275;j++);
    }
    void lcd_command(unsigned char comm) // function to send command to LCD
    {
    lcd_data_pin=comm;
    en=1;
    rs=0;
    rw=0;
    delay(1);
    en=0;
    }
    void lcd_data(unsigned char disp)    // function to send data on LCD
    {
    lcd_data_pin=disp;
    en=1;
    rs=1;
    rw=0;
    delay(20);
    en=0;
    }

    lcd_dataa(unsigned char *disp)    // function to send string to LCD
    {
    int x;
    for(x=0;disp[x]!=0;x++)
    {
    lcd_data(disp[x]);

    }
    }

    void lcd_ini()     //Function to inisialize the LCD
    {
    lcd_command(0x38);   
    delay(5);
    lcd_command(0x0F);       
    delay(5);
    lcd_command(0x80);
    delay(5);
     

    }
    void main()
    {
    while(1){
    lcd_ini();
    lcd_dataa(“A B :a;a”);

    }
    }

     

     

    Result: LCD Displays “A!C!;a;a”

    December 22, 2012 at 7:25 am #8872
    AJISH ALFRED
    Participant

    Hi,

    I found the following things that could be the reason

     

    You are calling lcd_ini() each time before writing a data.

    I can’t find where you’ve set the port P2 and P3 bits as output

     

    Now Check your port settings again, keep the lcd_ini() and lcd_dataa(“A B :a;a”); before the beginig of the infinite while loop and not inside it.

     

    Try and please don’t forget to update the result.

    December 31, 2012 at 2:31 pm #8887
    guyd
    Participant

    Sorry I did not write for a while.

     

     

    No, it did not help.

    I tried another methods to send data to LCD, more delays,

     

    trying to send a single letter, “B” which is 0x42, or 01000010, port on the card is on the right data, also port on the lcd is on the right data, but still the display show “C”.

    maybe LCD is defective?

    January 2, 2013 at 1:59 pm #8893
    AJISH ALFRED
    Participant

    May be! Lot of sample codes are available from the net for LCD interfacing. Test any of the simpleset code and find whether the problem persist.

    January 12, 2013 at 5:27 pm #8937
    guyd
    Participant

    4bit communication with LCD passed successfully.

     

    Thanks.

    January 18, 2013 at 9:59 am #8974
    prajwal
    Participant

    hi…

     

    I am interfacing LCD with the circuit and code provided in “ENGINEERS GARAGE” the only change i have made is i have used AT89S52 instead of AT89C51 as used in the tutorials.. Im not getting any output on the LCD.. where actually the problem is being occurred? help please..

    Thanks in advance.

    February 14, 2013 at 7:30 am #9131
    Syed Aameer
    Participant

    check the rs, rw and en pin correctly set…………….

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

RSS Recent Posts

  • need help in photodetection TIA circuit November 19, 2025
  • Need to solder a really delicate ribbon for an electric reel need advice November 18, 2025
  • Help please! BLDC driver circuit using the IR2136s and the STP80NF06 MOSFETS November 18, 2025
  • Measuring controller current output with a meter November 18, 2025
  • Anyone In The US Ordered From AliExpress Recently? November 17, 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