Linux-Options:
lcd4linux [-c key=val] [-F] [-f config-file] [-i[i]] [-o output] [-q] [-v]
| -c key=val | overwrite entries from the config-file (key and value have to be specified) |
| -F | do not fork and detach (run in foreground) |
| -f config-file | use configuration from 'config-file' instead of /etc/lcd4linux.conf |
| -i | enter 'interactive mode' (after display initialisation) |
| -ii | enter 'interactive mode' (before display initialisation) |
| -o output | write picture to 'output' (raster driver only) |
| -q | suppress startup and exit splash screen |
| -v | generate info messages |
| -vv | generate debugging messages |
| -h | print version number and a small help text, then exit |
| -l | list available drivers |
Start automatically during boot:
You have to create the startscript "/etc/init.d/lcd4linux" and generate the necessary runlevel entries by hand, e.g. with the command "ln -s /etc/init.d/lcd4linux /etc/rc5.d/S99lcd4linux".
Example for a startscript:
#! /bin/sh # # lcd4linux # PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin DAEMON=/usr/local/bin/lcd4linux NAME=lcd4linux DESC=lcd4linux test -f $DAEMON || exit 0 set -e case "$1" in start) echo -n "Starting $DESC: " start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON echo "$NAME." ;; stop) echo -n "Stopping $DESC: " start-stop-daemon --oknodo --stop --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON echo "$NAME." ;; reload) start-stop-daemon --stop --signal 1 --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON ;; restart|force-reload) echo -n "Restarting $DESC: " start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON sleep 1 start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON echo "$NAME." ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 exit 1 ;; esac exit 0 Alternatively you can invoke LCD4Linux within the file /etc/init.d/boot.local.
HD44780 Wiring
95% of all trouble with displays connected to the parallel port are due to wrong wiring! There is no "standard", whereupon the wiring should be carried out. Thus LCD4Linux supports the so-called "soft wiring", which means that you can use (nearly) any wiring you like. You just have declare it in lcd4linux.conf. A HD44780 display typically has 16 connections (if only 14 are available, then the connections for backlight are missing). The connections have the following meaning:
| Pin | Name | Comment |
| 1 | GND | ground |
| 2 | VCC | supply voltage +5V |
| 3 | LCD_DRIVE | contrast voltage (0 .. +5V) |
| 4 | RS | Register Select (low=instruction, high=data) |
| 5 | R/W | Read / not Write (high=read, low=write) |
| 6 | ENABLE | starts data read/write |
| 7 | DB0 | Data Bit 0 |
| 8 | DB1 | Data Bit 1 |
| 9 | DB2 | Data Bit 2 |
| 10 | DB3 | Data Bit 3 |
| 11 | DB4 | Data Bit 4 |
| 12 | DB5 | Data Bit 5 |
| 13 | DB6 | Data Bit 6 |
| 14 | DB7 | Data Bit 7 |
| 15 | BACKLIGHT | backlight supply voltage |
| 16 | BL GND | backlight ground |
The parallel port has 25 connections:
| Pin | Name | I/O |
| 1 | STROBE | Out |
| 2 | DB0 | I/O |
| 3 | DB1 | I/O |
| 4 | DB2 | I/O |
| 5 | DB3 | I/O |
| 6 | DB4 | I/O |
| 7 | DB5 | I/O |
| 8 | DB6 | I/O |
| 9 | DB7 | I/O |
| 10 | ACK | In |
| 11 | BUSY | In |
| 12 | PAPEROUT | In |
| 13 | SELECT | In |
| 14 | AUTOFD | Out |
| 15 | ERROR | In |
| 16 | INIT | Out |
| 17 | SLCTIN | Out |
| 18-25 | GND | n/a |
The data lines (DB0..DB7 on the display, DB0..DB7 on the parallel port) are always connected directly (unless you are using the 4-bit mode - but that is intended for experts rather, and these are not reading this tutorial anyway :-). The interesting part is, how the display's control signal is connected with the 4 possible output lines from the parallel port:
display:
Pin 4: RS (Register Select) Pin 5: R/W (Read/Write) Pin 6: Enable
parallel port:
Pin 1: Strobe Pin 14: AutoFD Pin 16: Init Pin 17: SelectIn
For each control line you have to specify, which signal of the parallel port is used. This is done by the "Wire.xy"-entries.
E.g. if you are using the popular WinAmp wiring, it has to be defined like this:
Display Pin 4 (RS) => Parallelport Pin 16 (Init) Display Pin 5 (R/W) => Parallelport Pin 14 (AutoFD) Display Pin 6 (Enable) => Parallelport Pin 1 (Strobe)
The adequate soft-wiring entries have to be:
Wire.RW 'AUTOFD' Wire.RS 'INIT' Wire.ENABLE 'STROBE' Wire.ENABLE2 'GND' Wire.BACKLIGHT 'GND' Wire.GPO 'GND'
Wiring example:
If you want to connect a standard HD44780 display to the parallel port using the WinAmp-Wiring, do it like the following:
| LCD | Parallel Port | Power Supply | contrast pot (10k) |
| Pin 1 | Pin 18 | GND | Pin 1 |
| Pin 2 | - | +5V | Pin 3 |
| Pin 3 | - | Pin 2 (slider) | |
| Pin 4 | Pin 16 | ||
| Pin 5 | Pin 14 | ||
| Pin 6 | Pin 1 | ||
| Pin 7 | Pin 2 | ||
| Pin 8 | Pin 3 | ||
| Pin 9 | Pin 4 | ||
| Pin 10 | Pin 5 | ||
| Pin 11 | Pin 6 | ||
| Pin 12 | Pin 7 | ||
| Pin 13 | Pin 8 | ||
| Pin 14 | Pin 9 | ||
| Pin 15 | - | 100 ohm resistor to +5V | |
| Pin 16 | - | GND |
TROUBLESHOOTING
Problems when compiling:
- problems with user rights? install as root user
- error in configure.log? try different configure options
e.g. errormessage
#error "gd.h not found!" make: *** [Raster.o] Error 1
workaround: configure --with-drivers=all,\!PNG
Problems starting LCD4Linux:
- rights on /etc/lcd4linux.conf set correctly?
- is the display initialised when starting LCD4Linux?
- invoke LCD4Linux with the options "-Fvvq" and have a look at the debug-output
- check syntax in lcd4linux.conf
