1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Trouble interfacing 16*2 lcd with arduino

Discussion in 'Arduino' started by dragonwarrior, Sep 20, 2012.

  1. dragonwarrior

    dragonwarrior New Member

    Joined:
    Oct 12, 2011
    Messages:
    19
    Likes:
    1
    hi everyone.
    i am new to arduino programming.
    When i interfaced JHD162A LCD with my arduino (ATMEGA 8) and uploaded the "Hello World "
    program in the arduino library,i get blank (no display) in the first row and black square boxes in the second row.

    I connected a 5K pot on pin 3 on the lcd and i was able to adjust the contrast of the lcd.
    but why this problem ? please help me..

    Any help will be appreciated..
    thanks in advance..
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,160
    Likes:
    909
    Location:
    Rochdale UK
    Are you using the LCD routines within the Arduino IDE? Are you using pin 9 or pin 10 for 'LCD E' ?

    If the contrast is adjusting, then the LCD isn't initialising..... Incidentally!!! Is the display upside down... An uninitialised display has black squares on the top row...
     
  3. dragonwarrior

    dragonwarrior New Member

    Joined:
    Oct 12, 2011
    Messages:
    19
    Likes:
    1
    yes,the lcd routine is within the arduino IDE.
    I am using pin 10 on arduino for LCD 'Enable'.
    i see black squares in bottom row and first row is blank.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,160
    Likes:
    909
    Location:
    Rochdale UK

    Have you an LCD shield? Or are you connecting directly to the pins....

    Can you show me the code..... Or which sketch are you using.... I just want to check that the sketch pin definitions are correct.
     
  6. dragonwarrior

    dragonwarrior New Member

    Joined:
    Oct 12, 2011
    Messages:
    19
    Likes:
    1
    since i have only little knowledge on soldering,i connected the lcd pins onto a breadboard and then to the arduino pins.
    I use arduino 1.0 and windows 7 as OS. I am using arduino ATMEGA8.
     
  7. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,160
    Likes:
    909
    Location:
    Rochdale UK
    First... When using a four wire databus... It isn't a good idea to use the RW pin... Ground this out and remove pin 11 from the init...

    Code (text):
    LiquidCrystal lcd(12, 10, 5, 4, 3, 2);
    Here is the wiring needed for that display..
     
  8. dragonwarrior

    dragonwarrior New Member

    Joined:
    Oct 12, 2011
    Messages:
    19
    Likes:
    1
    Tats how i connected the first time,yet i do have the same problem.
    I see no change in that.
     
  9. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,160
    Likes:
    909
    Location:
    Rochdale UK
    Is there anyway to can check the LCD unit? It might be dead!!! Have you another one...
     
  10. dragonwarrior

    dragonwarrior New Member

    Joined:
    Oct 12, 2011
    Messages:
    19
    Likes:
    1
    i will buy a new one and try..
     
  11. dragonwarrior

    dragonwarrior New Member

    Joined:
    Oct 12, 2011
    Messages:
    19
    Likes:
    1
    now it works fine!!
    There are few problems in the arduino lcd library..
    I tried the updated library which helped me connect the lcd properly to the arduino and then it worked well..
     
  12. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,160
    Likes:
    909
    Location:
    Rochdale UK
    Excellent news.... Happy programming
     

Share This Page