Hitachi HD44780
LCD Display Driver
for Linux

by Rudolf Szendrei


I used a simple 16x2 character LCD Display based on a popular Hitachi HD44780 compatible controller chip.
Concretely I bought an EW162G0 from by less then 4 Euros!

<< HERE >> you can download its datasheet.

I used an other datasheet/documentation for development, which text belongs to an other LCD Display. It was necessary, because it was very important to know everything about the device, and the chip of these displays are the same. You can << DOWNLOAD ITS FULL DATASHEET HERE >>


  • Pin assignment
    Pin No.On LCDPin No.On LPT port.
    1VSS (+5V)--
    2VDD (Ground)18-25Ground
    3V0 (Contrast)--
    4RS (Register Select)2DB0
    5RW (Read or Write)3DB1
    6Enable (Data Ready Signal)4DB2
    15VLED+ (Backlight)--
    16VLED- (Backlight)--

  • To see the text on the display, you need to add a 10k resistor as follows.

  • This device has a 4-bit and an 8-bit operation mode which depends on the initialisation (as you can see in the driver). Because 8-bit mode uses 11 pins, it is necessary to use the 4-bit mode with our LPT port.
  • Enable line indicates the controller ready to transmit data when it goes to 0 from logic 1.
  • RS line indicates whether data or instruction is provided by the user.
  • RW line indicates whether we are reading from or writing to the LCD device.
  • DB0 - DB3 are not used in 4-bit mode.
  • DB4 - DB7 used in both cases. By using 4-bit mode, we should transmit 8-bit datas in two parts.
  • Following commands are implemented in the HD44780 compatible controllers:
    • Clear display
    • Return cursor to home ( pos 0,0 )
    • Display On/Off
    • Cursor/Display shift
    • Function set
    • Set CGRAM address (character generator)
    • Set DDRAM address (data ram)
    • Read busy flag and address (flag eliminable by using correct delays in driver)
    • Write data to RAM (either CGRAM or DDRAM)
    • Read data from RAM (either CGRAM or DDRAM)
  • CGRAM contains the character bitmaps whiches can be displayed.
    The character map is the standard english ascii as we will see later.
    The bitmaps of first 8 characters can be redefined by their new bitmaps.


4-bit mode wiring


8-bit mode wiring (not supported in the driver)