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 display not working propery..

16×2 LCD display not working propery..

|

Microcontroller › AVR › 16×2 LCD display not working propery..

  • This topic has 9 replies, 7 voices, and was last updated 12 years, 2 months ago by Jay.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • May 26, 2012 at 3:25 pm #1817
    samynathan
    Participant

    i am  using this code in atmega16…. lcd is not displaying anything… someone plz help me.

     

    portb is control port

    portd is data port

     

    enable—pb2

    rw—pb1

    r/s—pb0

     

     

     

     

    #include<avr/io.h>
    #include<util/delay.h>
     
     
     
    void main()
    {
    DDRD=0xFF;
    DDRB=0x07;
     
    {
     
    {
    PORTD=0x38;
    PORTB=0b00000100;
    _delay_ms(10000);
    PORTB=0b00000000;
    _delay_ms(10000);
     
    }
     
     
     
    {
    PORTD=0x01;
    PORTB=0b00000100;
    _delay_ms(10000);
    PORTB=0b00000000;
    _delay_ms(10000);
     
     
    }
     
     
     
     
    {
    PORTD=0x0E;
    PORTB=0b00000100;
    _delay_ms(10000);
    PORTB=0b00000000;
    _delay_ms(10000);
     
    }
     
     
    {
    PORTD=0x80;
    PORTB=0b00000100;
    _delay_ms(10000);
    PORTB=0b00000000;
    _delay_ms(10000);
     
     
    }
     
     
     
    }
     
     
     
    unsigned char *str=”ENGINEERS GARAGE”;
     
     
    int i=0;
    while(str!=’’)
    {
     
    PORTD=str;
    PORTB=0b00000101;
    _delay_ms(10000);
    PORTB=0b00000001;
    _delay_ms(10000);
    i++;
      }
     
    }
     
     
     
     
     
     
     
    May 26, 2012 at 5:19 pm #7912
    AJISH ALFRED
    Participant

     

    Have you checked your circuit connections properly.

    Also there is no need to drive the r/w pin through the program. Since you are always writing into the LCD module, the r/w pin can be hardwired to ground.

    May 27, 2012 at 4:08 am #7915
    samynathan
    Participant

     

    its working in four bit mdesmiley….. but not for above program which is in 8 bit mode…sad

     

     

     

     

    wysiwyg_imageupload:4809:wysiwyg_imageupload:4808:

    June 9, 2012 at 2:09 pm #7981
    Ashish Koujalgi
    Participant

    Check your connections again. Use the reset pin to check for the working if all the connections are right. Connect the reset pin to the ground and remove. Should work fine if everything else is correctly bulit.

    June 9, 2012 at 4:29 pm #7982
    AJISH ALFRED
    Participant

     

    Hi,

     

    Your lcd not even initialized.

    Also note that the backlight is low and the contrast is set high.

    If it works in four bit mode and the code is proper, there should be some issues with the remaining four pins while using in 8 bit mode. Check the connections of those pins.

    June 11, 2012 at 12:03 pm #7998
    Amrith
    Participant

    Hi, 

    1. Recheck your hardware connections properly, take care that no data lines are getting sorted.

    2. Try varying the variable resistor.

    3. check whether you are following below steps to intialise LCD in the code

     

    Command –> RS=0, RW=0, E=1
    Data –> RS=1, RW=0, E=1
    4. To Intilaise LCD in 8-Bit mode use command 0x38 in hex or 56 in decimal format.
    June 11, 2012 at 12:04 pm #7999
    Amrith
    Participant

    Hi, 

    1. Recheck your hardware connections properly, take care that no data lines are getting sorted.

    2. Try varying the variable resistor.

    3. check whether you are following below steps to intialise LCD in the code

    Command –> RS=0, RW=0, E=1
    Data –> RS=1, RW=0, E=1
    4. To Intilaise LCD in 8-Bit mode use command 0x38 in hex or 56 in decimal format.
    December 19, 2012 at 1:44 pm #8856
    Nirav Tejani
    Participant

    Hi samyanthan,

                 your code is perfect.check your lcd wire connection with controller and check all pins carefully….whether any one shorts with another???

     

     

    May 4, 2013 at 12:27 pm #9627
    mahendra singh
    Participant

    connect ur VEE pin of LCD to ground nd check

    January 1, 2014 at 5:15 pm #10811
    Jay
    Participant

    I am also facing same problem.

    My program is correct.

    But, I still get no output on LCD.

    It displays same as yours 1st line blank & 2nd line full.

    Still found no solution to it.

    Can’t detect where I am making mistake………

  • 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

  • H bridge current direction logic March 11, 2026
  • Very Curious Issue With DS3231 RTC Clock March 10, 2026
  • Distorted output from buffer March 10, 2026
  • Motor Getting Hot March 10, 2026
  • excessive technology in multimeters March 10, 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