HD44780 LCD and initialising

Discussion in 'General Electronics Chat' started by hunterage2000, Feb 18, 2013.

  1. hunterage2000

    Thread Starter Active Member

    May 2, 2010
    400
    0
    Does anyone have the assembly code to initialise an HD44780 LCD? I tried using it with an arduino and some code but it didnt work and only showed a row of black squares. Apparently I need to initialise the LCD to get rid of these and get it working. The datasheet shows how to intialise it with a 8051 Microprocessor only.
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,452
    3,371
    Surely the arduino library and user base already have this covered.
    Are you using it in 4-bit or 8-bit interface mode?
     
  3. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    Arduino.cc has such code available.
     
  4. hunterage2000

    Thread Starter Active Member

    May 2, 2010
    400
    0
    Im not sure but there is a header file called LiquidCrystal.h. I used a basic example from the examples file.

    Code ( (Unknown Language)):
    1.  
    2. #include <LiquidCrystal.h>
    3.  
    4. // initialize the library with the numbers of the interface pins
    5. LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
    6.  
    7. void setup() {
    8.   // set up the LCD's number of columns and rows:
    9.   lcd.begin(16, 2);
    10.   // Print a message to the LCD.
    11.   lcd.print("hello, world!");
    12. }
    13.  
    14. void loop() {
    15.   // Turn off the cursor:
    16.   lcd.noCursor();
    17.   delay(500);
    18.    // Turn on the cursor:
    19.   lcd.cursor();
    20.   delay(500);
    21. }
    22.  
    23.  
    This is a 4-bit mode example
     
  5. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    They can be a bit finicky to be put to working order. When you have done it 10 or twenty times, this will no longer be a problem.

    The interface was designed in the early 1980s and set into stone- became a worldwide standard.

    Nowadays if designed freshly, they'd have a foolproof serial interface with a default mode, and no crashing possible (or at least not so easily).

    They are very likely mask programmed, not using a program FLASH.
     
Loading...