The HD44780 Driver

There are several ways of wiring up the HD44780 devices. Your choice will probably be governed largely by your ability to wire up each one and/or a desire to use the device with other programs.

The LCDproc HD44780 driver supports the following connections on a parallel port:

It also supports the following connections:

The driver also lets you use multiple displays as a single virtual display. For example, a 4, 2 and 1 line display can be used to form a 7 line display. The number of displays is limited by the individual HD44780 driver.

Connections

Common connections for all connectiontypes

No matter what connectiontype you choose, you will always need some connections. They are explaned here.

Power

All variants use the same method of obtaining power. i.e., for each LCD:

Table 5.1. HD44780: Power Connections

LCDpinsignal
1GND(connect to any of pins 18 - 25 of you parallel port)
2+5V 
3Vadj(contrast)

Warning

Always double check your power connection, your display will probably not survive a reversely connected supply !

There are several ways to get 5V:

  • Connect to a 5V line intented for disk drives (the red wire is 5V, black is GND).

  • Get it from a joystick port (pin 1 and 9 are 5V, 4, 5 and 12 are GND). It seems that some soundcards can use these lines for communication, so if you want to use this first check wether it really gives a 'clean' 5V.

  • If you don't have a backlight, you can sometimes get the needed mA's from the LPT port itself. Connect a few diodes from the data pins to a capacitor and you have the 5V. If it's strong enough is another question...

  • Get it from the keyboard connector. I do not recommend to use this with a backlight, as the keyboard connector is often protected with a fuse of 100mA or 200mA.

Figure 5.1. HD44780: Connecting the contrast adjusting pin (Vadj.)



     (variable resistor)
        .------.
 Vcc ---|  10k |--- GND
        `---^--'
           /|\
            |
          Vadj.



Keypad

You can connect a keypad with most connection types. The maximum supported number of keys differs per type. There are several ways to connect the keys to the input pins.

Direct Keys

If you connect a key like sketched below, then you can only connect one key per input pin. It is a simple solution if you need only few keys.

Figure 5.2. HD44780: Direct Keys



      O 5V
      |
      |
      -
     | | 10k
     | |
      -
      |
      +-----------o input  (X)
      |
      |
      o
       \
      o
      |
      |
     === GND



By default, the following keystrokes are generated by the different keys:

Table 5.2. HD44780: Direct Key Mapping

X0A
X1B
X2C
X3D
X4E

Matrix Keys

Using a matrix, we can connect much more keys. To simplify the drawing here, we replace all switches with an @ symbol:

Figure 5.3. HD44780: Single Matrix Key



             X line
                |
                |
  Y line ---+---------
            |   |                    |
            o   |               =  --@--
             \  |                    |
            o   |
            |   |
            +---+
                |
                |



We connect the matrix of keys like this:

Figure 5.4. HD44780: Complete Key Matrix



Y0 o---|<---@--@--@
            |  |  |
Y1 o---|<---@--@--@
            |  |  |
Y2 o---|<---@--@--@
            |  |  |
Y3 o---|<---@--@--@            O 5V
            |  |  |            |
    diodes  |  |  |     ___    |
    1N4148  +----------|___|---+
            |  |  |     ___    |
            |  +-------|___|---+
            |  |  |     ___    |
            |  |  +----|___|---+     resistors 22k
            |  |  |
            o  o  o
            X0 X1 X2



As you can see, you need 1 resistor per X line, and 1 diode per Y line. Lcdproc will presume that you have a keypad with a layout like a telephone connected, with X and Y lines connected as show. To be more precise, it assumes this:

Table 5.3. HD44780: Matrix Keypad Layout

 X0X1X2X3X4
Y0123AE
Y1456BF
Y2789CG
Y3*0#DH

If you only need 10 keys, leave the rest away. However, the lcdproc menu is controlled by the keystrokes A to D. You should modify and recompile the driver to get an other keypad layout.

You can buy arrays of keys that are connected like this in the electronics shop. They usually call it a matrix keypad. To hook it to lcdproc, you would only need to add the resistors and diodes.

If you want to use just one return line, for example with the serialLpt wiring, it looks (completely drawn) like this:

Figure 5.5. HD44780: One Return Line



                  O 5V
                  |
                 .-.
                 | | 4k7 or 22k
     diodes      | |
     1N4148      '-'
            ___   |
Y0 o---|<---o o---+
            ___   |
Y1 o---|<---o o---+
            ___   |
Y2 o---|<---o o---+
            ___   |
Y3 o---|<---o o---+----o return line



Tip

If the driver generates keypresses without that you actually press a key, it might be that the unconnected input lines are picking up electromagnetic waves from the air. In that case connect the unconnected input lines (pin 10, 11, 12, 13 and 15 of the LPT) to VCC = 5V.

Backlight

A small extension allows you to switch the backlight of the display on and off. At the moment only the 4bit and winamp connection types support this. The extension uses one output pin, you cannot use that pin for other functions anymore. The wiring looks like this:

Figure 5.6. HD44780: Backlight Wiring



                                             O 5V
                                      ___    |
                                 +---|___|---+
LPT Sub-D connector              |   4k7     |
                                 |           |e
                          ___    |       b |/
     BL pin o------------|___|---+---------|
                          1k               |\
                                       BC327 |c
                                             |        LCD connector
                                             |
                                             +--------o 15 backlight

                                             +--------o 16 GND backlight
                                             |
                                            === GND

Note: 4k7 means 4,7 kOhm.
The BC327 transistor has the following connections:

     _____
    |     |
    |BC327|
    |_____|
     | | |
     | | |
     | | |
     c b e



Caution

Sometimes the backlight connections are not on the 'main' connector, but on the side. If that is the case, there is usually NO RESISTOR present to limit the current through the LEDs. Therefor you should then add a resistor after the transistor of about 10 ohm (see display documentation).

Tip

If you want the backlight to light a bit while it's switched 'off', you can add a resistor bypassing the transistor from e to c, with a value of, say 47ohm or 22ohm. (My 4x20 has an internal resistor of 6ohm, so with 47 ohm extra it lights at only 1/9th. I like this. Joris.)

4bit

This is originally based on "lcdtext" (by Matthias Prinke).

Table 5.4. HD44780: 4bit Pinouts (1)

printer portLCD
namepinnamepin
D02D411
D13D512
D24D6(13)
D35D714
D46RS4
D57RW5 (LCD3 - 6) (optional - pull all LCD RW low (*) )
D68EN6
D79EN2(LCD2 - 6) (optional)

(*) on the RW line of the display: this line decides whether the display receives data from the LPT port, or whether it sends data to the LPT port. If grounded, it receives. If High or connected to nothing at all, it "sends" (i.e., will not work as intended). So, if you are not sure that you need it otherwise, then connect it to GND. This certainly applies if you have only one display.

If you want to connect more than two displays to the parallel port then wire D5 (pin 7) to the enable line (pin 6) of the third LCD. Then for displays four to seven use:

Table 5.5. HD44780: 4bit Pinouts (2)

printer portLCD
STR (1)EN4
LF (14)EN5
INIT (16)EN6
SEL (17)EN7

The optional keypad can be connected as follows:

Table 5.6. HD44780: 4bit Keypad Pinouts

printer portLCD
D0 (2)Y0
D1 (3)Y1
D2 (4)Y2
D3 (5)Y3
D4 (6)Y4
D5 (7)Y5
nSTRB (1)Y6
nLF (14)Y7
INIT (16)Y8
nSEL (17)Y9
nACK (10)X0
BUSY (11)X1
PAPEREND (12)X2
SELIN (13)X3
nFAULT (15)X4

The optional backlight wiring should be connected to D5, pin 7.

8bit "Winamp"

This type of connection should work with winamp.

Table 5.7. HD44780: "Winamp" wiring

printer portLCD
namepinnamepin
D02D07
D13D18
D24D29
D35D310
D46D411
D57D512
D68D613
D79D714
nSTRB(1)EN6
nLF14nRW5 (EN3 6 - LCD 3) (optional (*) )
INIT16RS4
nSEL17EN26 - LCD 2) (optional)

(*) on the RW line of the display: this line decides whether the display receives data from the LPT port, or whether it sends data to the LPT port. If grounded, it receives. If High or connected to nothing at all, it "sends" (i.e., will not work as intended). So, if you are not sure that you need it otherwise, then connect it to GND. This certainly applies if you have only one display.

If you want the display to work with the Winamp plugin, wire nLF (pin 14) to nRW of your LCD. You can then use the plugin in bidirectional mode (wich is much faster). With 3 connected LCDs this is not possible. Note from Benjamin: I haven't tried using winamp while having the third LCD connected to this line.

The optional keypad can be connected as follows:

Table 5.8. HD44780: "Winamp" wiring - Keypad

printer portkeypad
D0 (2)Y0
D1 (3)Y1
D2 (4)Y2
D3 (5)Y3
D4 (6)Y4
D5 (7)Y5
D6 (8)Y6
D7 (9)Y7
nLF (14)Y8
INIT (16)Y9
nACK (10)X0
BUSY (11)X1
PAPEREND (12)X2
SELIN (13)X3
nFAULT (15)X4

The optional backlight wiring should be connected to nSEL, pin 17.

8bit "lcdtime"

This is originally based on "lcdtime" (by Benjamin Tse ) and allows you to combine the LCD with a LED bargraph. The LCD is driven by LCDproc and the LEDs by another program such as portato. Further details can be obtained from:

http://metalab.unc.edu/pub/linux/system/status/lcdtime-0.2.tar.gz http://metalab.unc.edu/pub/linux/system/status/meter-0.2.tar.gz http://metalab.unc.edu/pub/linux/system/status/portato-1.2.tar.gz

Note

Theoretically this wiring sends the data over twice as slow as the winamp or ext8bit wirings, because it only sends 4 bits at a time.

The LCD connections are:

Table 5.9. HD44780: "lcdtime" wiring

printer portLCD
namepinnamepin
D02D07
D13D18
D24D29
D35D310
D46D411
D57D512
D68D613
D79D714
nSEL17- 
nSTRB1RS4
nLF14RW5 (LCD2 - 6) (optional - pull all LCD RW low (*)
INIT16EN6

(*) on the RW line of the display: this line decides whether the display receives data from the LPT port, or whether it sends data to the LPT port. If grounded, it receives. If High or connected to nothing at all, it "sends" (i.e., will not work as intended). So, if you are not sure that you need it otherwise, then connect it to GND. This certainly applies if you have only one display.

See the lcdtime tar-ball (above) for full details of the bargraph connections.

The optional keypad can be connected as follows:

Table 5.10. HD44780: "lcdtime" wiring - keypad

printer portkeypad
D0 (2)Y0
D1 (3)Y1
D2 (4)Y2
D3 (5)Y3
D4 (6)Y4
D5 (7)Y5
D6 (8)Y6
D7 (9)Y7
nSTRB (1)Y8
nSEL (17)Y9
nACK (10)X0
BUSY (11)X1
PAPEREND (12)X2
SELIN (13)X3
nFAULT (15)X4

The backlight wiring should be attached to nSEL, pin 17. Because the portato program (mentioned above) also uses this pin to control the bargraph, you cannot use the backlight control together with the bargraph.

Serial LPT

This interface uses a handful of wires to interface to the HD44780. Suitable for high noise, long connections. Designed by Andrew McMeikan . The original wiring and driver can be found at:

http://members.xoom.com/andrewmuck

I (Joris) have extended this driver and the wiring a bit. It now supports keys again (it had earlier supported keys, but some time did not).

Further I have extended the driver and the wiring to be able to run using 2 instead of 3 output pins. That's even one less pin ! :)

Of course the use of fewer lines than the other wirings can not stay without drawbacks. In this case the simplicity of the long feeding wires is compensated by some intelligence in the decoding of the data. If you have no experience with the soldering iron, I do not recommend to build this wiring.

OK, so here is the wiring. First of the 'simple' 3 wires version. IC1 is the shift register, a 4094. Do not forget to connect the 5V to pin 16 and GND to pin 8 of the IC.

Figure 5.7. HD44780: Serial LPT wiring ('simple')



                                      IC1
                                   -----------
                                  |   4094    |
                            5V    | shift reg |                    display
                             O    |           |                            keys
                             |   1|           |4
                             +----|STR      Q0|--------------------o 11 D4   Y0
                             |    |           |5
           Data              |   2|         Q1|--------------------o 12 D5   Y1
   D3 5 o-------------------------|D          |6
                             |    |         Q2|--------------------o 13 D6   Y2
                             |   3|           |7
   D4 6 o-------------------------|CK       Q3|--------------------o 14 D7   Y3
                             |    |           |14
                             |  15|         Q4|--------------------o         Y4
                             +----|OE         |13
                                  |         Q5|--------------------o 4  RS   Y5
                                  |           |12
                                  |         Q6|--------------------o         Y6
                                  |           |11
                                  |         Q7|--------------------o         Y7
                                  |           |9
                                  |         QS|--               +--o 5  RW
                                  |         __|10               |
                                  |         QS|--              ===
                                  |           |
                                   -----------

   D2 4 o----------------------------------------------------------o 6 EN

   D7 9 o----------------------------------------------------------o 6 EN2
                                                                     (2nd LCD)


          5V  O-----+--------+-------------------------------+-----o 2 VCC
                    |        |                               |
                    |        |                               |
                    |100n    O 16                           .-.
                   ---      IC1                             | |<---o 3 Vlcd
                   ---       O 8                            | |10k
                    |        |                              '-'
   GND              |        |                               |
 18..25 o-----------+--------+-----------------------+-------+-----o 1 GND
                                                     |
                                                    === GND



The second possible wiring is with 2 output lines. This one is a bit more complex. If you do not understand the schematic, do not build it.

Figure 5.8. HD44780: Serial LPT wiring ('complex')



                                      IC2
                                   -----------
                                  |  74HCT164 |
                                  | shift reg |                    display
                                  |           |                            keys
           Data                  1|           |3
   D3 5 o---------------------+---|D        Q0|--------------------o 11 D4   Y0
                              |   |           |4
                              |  2|         Q1|--------------------o 12 D5   Y1
                              +---|D          |5
                                  |         Q2|--------------------o 13 D6   Y2
                                  |           |6
                                  |         Q3|--------------------o 14 D7   Y3
                                  |           |10
           Clock                 8|         Q4|--------------------o         Y4
   D4 6 o-------------------------|CK         |11
                                  |         Q5|--------------------o 4  RS   Y5
               ___       9|\ 8   9|_          |12
           +--|___|--+----| >o----|R        Q6|--------------------o         Y6
           |   22k   |    |/      |           |13
           |        ---   IC1     |         Q7|---+             +--o 5  RW
           |        ---           |           |   |     5V      |
           |         |100p         -----------    |     O      ===
           |         |                            |     |
           |        ===                           |    .-.
           |                                      |    | |22k
           +--------------------------------------+    | |
           |                                           '-'
           |   ___      11|\ 10                         |   5|\ 6
           +--|___|--+----| >o-------------------||-----+----| >o--o 6 EN
               22k   |    |/                    22p          |/
                    ---   IC1                                IC1
                    ---
                     |22p
                     |            IC1=74HCT14 (6x Schmitt trigger inverter)
                    ===


        5V  O--+-------+------+------+-----------------------+-----o 2 VCC
               |       |      |      | 13|\ 12               |
               |       |      |      +---| >o-               |
               |100n   O 14   O 14       |/                 .-.
              ---     IC1    IC2                            | |<---o 3 Vlcd
              ---      O 7    O 7       1|\ 2      3|\ 4    | |10k
               |       |      |       +--| >o-   +--| >o-   '-'
   GND         |       |      |       |  |/      |  |/       |
 18..25 o------+-------+------+-------+----------+-----+-----+-----o 1 GND
                                                       |
                                                      === GND



Serial LPT Keypad

Note

To understand this part of the serialLpt documentation, you also need to read the keypad section in this document.

serialLpt wiring supports a keypad. The 3 wires version supports 8 keys, or if you use multiple return lines up to 8 x 5 = 40 lines. The 2 wires version supports 7 keys, or with multiple return lines 7 x 5 = 35 keys.

Table 5.11. HD44780: Serial LPT - Keypad return lines

nACK (10)X0
BUSY (11)X1
PAPEREND (12)X2
SELIN (13)X3
nFAULT (15)X4

On lines longer than, say a meter, you should buffer the return line(s). If you only have 1 return line, you can buffer it with two remaining buffers from the 74HCT14:

Figure 5.9. HD44780: Serial LPT - Keypad return lines buffered



               1|\ 2    13|\ 12   ___
   keypad o-----| >o------| >o---|___|---+---o input pin on LPT port
   return       |/        |/      220E   |
                IC1       IC1           ---
                                        --- 1nF
                                         |
                                        ===



Serial LPT Backlight

Also a backlight is suported. You will also need a port from the 74HCT14 for that. The BL output below should be connected to the BL input in the backlight section

Figure 5.10. HD44780: Serial LPT - Backlight extra circuit



                 ___       3|\ 4
     Data o-----|___|--+----| >o----o BL output
   LPT-D3       470k   |    |/
                      ---   IC1
                      ---
                       |100nF
                       |
                      ===



LIS2 USB device "lis2"

LIS2 from VLSystem (http://www.vlsys.co.kr) is a full featured USB VFD module with four channel fan controls. This device can be accessed as a serial device with the help of the kernel modules ftdi_sio.ko that map the USB port to a serial port (/dev/ttyUSBx).

LCD on Serial panel device "los-panel"

See http://www.xs4all.nl/~mlf/los/ for more information on this device.

VDR LCD serial device "vdr-lcd"

… to be documented …

Please address Matteo Pillon for further information.

VDR-Wakeup module "vdr-wakeup"

The VDR-Wake module by Frank Jepsen is a serial IO extension module for the famous Linux-based VDR that allows to connect an LCD to it and supports LCDproc.

See http://www.jepsennet.de/vdr/ (German) for more information on VDR-Wakeup.

Pertelian X2040 "pertelian"

The Pertelian X2040 includes an HD44780 display with enclosure and USB connection. In order to work with LCDproc in Linux you need the usbserial.ko and ftdi_sio.ko kernel modules loaded. The display will then be available on a serial port /dev/ttyUSBx.

See the X4020 product page for more information.

PIC-an-LCD serial device "picanlcd"

The PIC-an-LCD module is also supported. It is not connected to the LPT port but to a serial port, which saves you from a lot of potential problems. To use it, specify the device to which you have connected the module in the config file with the Device= setting. The default is /dev/lcd. It does not support a keypad nor backlight switching.

For more information see the PIC-an-LCD User Manual by Dale Wheat.

LCD serializer device "lcdserializer"

LCD serializer connection is technically the same as PIC-an-LCD with the same advantages, it uses the serial port making things really simple. Unlike PIC-an-LCD LCD serializer is not a commercial product. it's just a project found digging on the net and freely available. You have all the tools and the code to build it yourself and to customize the behaviour of the device.

What you need

  • Some electronic knowledge and familiarity with the soldering iron

  • A PIC16F84 (I used PIC16F84A) or PIC16C54

  • JDM PIC programmer

  • gputils and picprog installed on your GNU/Linux box

Burning the PIC

First, you need to download the ASM source for your PIC and then make the hex:

$ gpasm lcd16f84_custom.asm

Now the binary is ready to be flashed to the PIC. Connect the programmer with the PIC installed and issue the following command to see it burning ;-):

$ picprog --erase --burn --input lcd16f84.hex --pic /dev/ttyS0
Running lcdproc

It's time to build the operating circuit, remember this driver uses a baud rate of 9600, so JP2 need to be closed.

Now power on the board. You should see OK on the LCD screen. Otherwise double-check all the connections.

Change LCDd.conf to include the following statements in the [hd44780] section:

ConnectionType=lcdserializer
Device=/dev/ttyS0

Finally, start the daemon and relax watching lcdproc running.

Customizing startup message

If want to change the default startup message (OK.), you can edit the asm source and write anything you want. Open the asm source with your preferred editor and look for this:


;******* START Main Loop Here **************

; This is where we should insert any little startup LCD messages...
;   Print "OK." on startup...
                        movlw   0x4F
                        movwf   ARG1
                        call    SendLCDData
                        call    InitDelay200MS
                        movlw   0x4B
                        movwf   ARG1
                        call    SendLCDData
                        call    InitDelay200MS
                        movlw   0x2E
                        movwf   ARG1
                        call    SendLCDData
                        call    InitDelay200MS

This piece of code sends three characters to the LCD. The first line sets the value of w register (working register, aka accumulator) to 0x4F ('O' in ascii). The second line copies this value to ARG1, then the value is sent to the LCD. The fourth line delays the execution.

You don't have to write the ASCII values in your modification, gpasm does the translation for you, so if you want to see Booting... at startup, change the code above to look like this:


;******* START Main Loop Here **************

; This is where we should insert any little startup LCD messages...
;   Print "Booting..." on startup...
                       movlw   'B'
                       movwf   ARG1
                       call    SendLCDData
                       call    InitDelay200MS
                       movlw   'o'
                       movwf   ARG1
                       call    SendLCDData
                       call    InitDelay200MS
                       movlw   'o'
                       movwf   ARG1
                       call    SendLCDData
                       call    InitDelay200MS
                       movlw   't'
                       movwf   ARG1
                       call    SendLCDData
                       call    InitDelay200MS
                       movlw   'i'
                       movwf   ARG1
                       call    SendLCDData
                       call    InitDelay200MS
                       movlw   'n'
                       movwf   ARG1
                       call    SendLCDData
                       call    InitDelay200MS
                       movlw   'g'
                       movwf   ARG1
                       call    SendLCDData
                       call    InitDelay200MS
                       movlw   '.'
                       movwf   ARG1
                       call    SendLCDData
                       call    InitDelay200MS
                       movlw   '.'
                       movwf   ARG1
                       call    SendLCDData
                       call    InitDelay200MS
                       movlw   '.'
                       movwf   ARG1
                       call    SendLCDData
                       call    InitDelay200MS

Refer to burning section in order to compile and reflash the new firmware.

BWCT USB device "bwctusb"

The BWCT USB LCD module is also supported. It is not connected to an LPT port but to an USB port, which saves you from a lot of potential problems. To use it, set the connection type in the config file with the ConnectionType= setting to "bwctusb" (without the quotes). It does neither support a keypad nor backlight switching but it supports setting the display's contrast using the "Contrast" configuration parameter as well as specifying which one (of multiple BWCT LCD devices) is wanted using the "SerialNumber" configuration parameter.

Till Harbaum's "lcd2usb"

LCD2USB is a cheap but powerful do-it-yourself interface to connect HD44780 based displays via USB, consisting of easily available parts only. The device supports software adjustable contrast and backlight as well as dual controller displays (required for 4*27 and 4*40).

It is based upon Atmel AVR Mega8 CPU with a pure software implementation of the USB protocol for the Atmel AVR microcontroller series.

The whole interface incl. the hardware layout is under a GPL like license. This means that you can take these schematics and use it as a basis for your own interface e.g. for a graphic LCD

Special config options

Besides the standard configuration options for hd44780 displays, the lcd2usb connection type supports two additional options: Contrast= to set the display's contrast and Brightness= to set the display's brightness. Both options expect a number in the range from 0 to 1000.

Status

The lcd2usb connection type has been written to support displays with one and two HD44780 controllers. Owing to the lack of a 2-controller display, it has only been tested with a 1-controller display. If you happen to have a 2-controller display connected to LCD2USB, please report to the mailing list.

Tip

In order to make the lcd2usb connection type work with a 2-controller display you may need to set the vSpan= config option accordingly.

Although the LCD2USB sports two keys, they are currently not supported by LCDproc. Patches to fix the situation are very welcome.

I2C with Port-Expander

If you have an I2C port available that is supported by your kernel (through /dev/i2c*), you can add a I2C port expander there (PCF8574P in this example).

Figure 5.11. HD44780: PCF8574P port expander on I2C bus


                                       IC1
                                   -----------
                                  | PCF8574P  |
                                  | I2C-Port- |                            HD44780
                                  | Expander  |                            display
                                  |           |4
                                  |         P0|----------------------------o 11 D4
                                  |           |5
           I2C-Bus              14|         P1|----------------------------o 12 D5
    SCL o-------------------------|SCL        |6
                                  |         P2|----------------------------o 13 D6
                                15|           |7
    SDA o-------------------------|SDA      P3|----------------------------o 14 D7
                                  |           |9
                                  |1        P4|----------------------------o 4  RS
           Set I2C-Address  +-----|A0         |10
           here:            |     |2        P5|----------------------------o 5  RW
           GND: Bit:=0      +-----|A1         |11
           VCC: Bit:=1      |     |3        P6|----------------------------o 6  EN
                            +-----|A1         |                      ___
           Here: 0x00       |     |           |                 +---|___|--o 15 backlight
                           ===    |           |                 |c   10R
                                  |           |12    ___       b|/ 
                                  |13       P7|-----|___|-----|
                                 -|INT        |      1k       |\
                                  |           |           bc557 |e
                                   -----------                  |
                                                                |
    +5V o-----------+------------------+---------------------+--+----------o 2  VCC
                    |                  |                     |
                    |                  |                     |
                    |10uF              O 16                 .-.
                   ---                IC1                   | |<-----------o 3  Vlcd
                   ---                 O 8                  | |10k
                    |                  |                    '-'
                    |                  |                     |
    GND o-----------+-------+----------+---------------------+-------+-----o 1  GND
                            |                                        |
                           === GND                                   +-----o 16 GND Backlight


Configuration

Example 5.1. HD44780: Configuration for I2C with port expander


[HD44780]
ConnectionType=i2c
Device=/dev/i2c-0
Port=0x20
Backlight=yes
Size=40x2
DelayBus=false
DelayMult=1
Keypad=no


The Device= configuration setting denotes the device file of your I2C bus (here /dev/i2c-0). You have to load the kernel standard module i2c-dev.ko and the bus driver, but no I2C chip modules (e.g. pcf8574.ko)!

The Port= config option contains the I2C address of the I2C port expander (here 0x20, the PCF8574 from the example above, with all address bits set to 0). Bit 8 of the address (normally 0 in I2C addresses) has a special meaning: It tells the driver to treat the device as PCA9554 or similar, a device that needs a 2-byte command, and it will be stripped off the address.

Table 5.12. HD44780: Examples of I2C port expander addresses

Port= valueMeaning
0x200x27PCF8574 with A[012]=07
0x380x3fPCF8574A with A[012]=07
0xa00xa7PCA9554 with A[012]=07
0xa00xa7PCA9554A with A[012]=07

Compiling

Make sure that the HD44780 files are built when you run ./configure. This can be done by specifying --enable-drivers=all or by including hd44780 in the list of enabled drivers (e.g. --enable-drivers=hd44780).

Configuration in LCDd.conf

[hd44780]

Port= PORT

Specify the address of the parallel port the LCD is connected to. Common values for PORT are 0x278, 0x378 and 0x3BC. If not given, the default is 0x378.

Device= DEVICE

If you are using a serial connection, you must set this parameter to the device your LCD is connected to. For example, if the display is connected to the first serial port, you have to set it to /dev/ttyS0. The default value is /dev/lcd.

ConnectionType= { 4bit | 8bit | winamp | serialLpt | picanlcd | lcdserializer | los-panel | vdr-lcd | vdr-wakeup | pertelian | bwctusb | lcd2usb | lis2 | i2c }

Select the type of the wiring / display connection.

ConnectionTypeWiring / Display Type
4bitHD44780 4bit Wiring (default)
8bitHD44780 8bit Wiring ("lcdtime")
winampHD44780 8bit Wiring "winamp" Style
serialLptHD44780 Serial LPT Wiring
picanlcdPIC-an-LCD serial device "picanlcd"
lcdserializerLCD serializer "lcdserializer"
los-panelLCD on Serial panel device "los-panel" (http://www.xs4all.nl/~mlf/los/)
vdr-lcdVDR LCD serial device "vdr-lcd"
vdr-wakeupVDR-Wakeup module "vdr-wakeup"
pertelianPertelian X2040 LCD display (http://pertelian.com/joomla/index.php?option=com_content&task=view&id=43&Itemid=48)
bwctusbBWCT USB device "bwctusb" (http://www.bwct.de/lcd.html)
lcd2usbTim Harbaum's LCD2USB (http://www.harbaum.org/till/lcd2usb/)
lis2LIS2 from VLSystem (http://www.vlsys.co.kr)
i2cLCD driven by PCF8574(A)/PCA9554(A) connected via I2C

Tip

The above table might be outdated, when you read this. If you suspect the table above to be outdated, you might want to have a look at server/drivers/hd44780-drivers.h in LCDproc's source directory which contains the actual translation code.

Speed= BITRATE

For a serial connection, set to the serial port bitrate. To use the default value for the chosen interface, just set to 0.

Charmap= { hd44780_default | ea_ks0073 }

You need to set this parameter only if you do not have a standard HD44780 display. ea_ks0073 is the charmap for Electronic Assembly's KS0073 based displays. These devices have a richer charset, including many icons and many more characters of the ISO-8859-1 than standard HD44780s. Refer to hd44780-charset.h for more information.

Keypad= { yes | no }

Tell whether you have a keypad connected. You may also need to configure the keypad layout further on in this file.

Contrast= CONTRAST

Set the initial contrast for the bwctusb connection type. Legal values for CONTRAST are 0 - 1000. If not given, it defaults to 300.

Backlight= { yes | no }

Specifiy if you have a switchable backlight.

OutputPort= { yes | no }

Tell if you have the additional output port ("bargraph") and you want to be able to control it with the lcdproc OUTPUT command.

Lastline= { yes | no }

Specifies whether the lowest pixel line of a character is pixel addressable or if it controls an underline effect. The default is yes, meaning a pixel addressable last pixel line.

Size= WIDTH x HEIGHT

Specifies the size of the LCD. Default: 20x4 In case of multiple combined displays, this should be the total size.

vSpan= HEIGHT ,

The "vertical span" when using multiple displays or multi-controller displays. It is a comma separated list of the heights of each display. In multi-controller displays it lists the number of lines each controller is responsible for.

E.g. VSpan=2,2 means you have two displays and each has two lines.

The sum of the HEIGHTs must match the total height given in Size=.

ExtendedMode= { yes | no }

If you have a KS0073 or an other 'almost HD44780-compatible', set this flag to get into extended mode (4-line linear). This flag is NOT the old obsolete Extended option.

DelayMult= DELAY

If your display is slow and cannot keep up with the flow of data from LCDd, garbage can appear on the LCDd. Set this delay multiplier to 2 or 4 to increase the delays. The default is 1 for a non-multiplied delay.

DelayBus= { yes | no }

You can reduce the inserted delays by setting this to no. On fast PCs it is possible your LCD does not respond correctly. Default: yes.

KeepAliveDisplay= SECONDS

Some displays (e.g. vdr-wakeup) need a message from the driver to that it is still alive. When set to a value bigger then 0 the character in the upper left corner is updated every SECONDS seconds. The default 0 does not cause any extra updates.

RefreshDisplay= SECONDS

If you experience occasional garbage on your display you can use this option as workaround. If set to a value bigger than 0 it forces a full screen refresh SECONDS seconds. Default: 0.

DirectKey_NUM= KEY , KeyMatrix_X_Y= KEY

If you have a keypad you can assign keystrings to the keys. See documentation for used terms and how to wire it.

To map, for example, the directly connected key 4 to the string Enter, use KeyDirect_4=Enter. For matrix keys use the X and Y coordinates of the key; e.g. KeyMatrix_1_3=Enter.

Miscellania

This text has originally been taken from a message by Bill Farrow .

Updated February 2000, Benjamin Tse

Updated October 2001, Joris Robijn

Converted to docbook March 2002, Rene Wagner

Updated April 2002, Rene Wagner

Updated and extended April 2006, Peter Marschall