<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <HTML ><HEAD ><TITLE >LCDproc Drivers</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="LCDproc User's Guide" HREF="book1.html"><LINK REL="PREVIOUS" TITLE="The LCDproc Init Scripts" HREF="x402.html"><LINK REL="NEXT" TITLE="Parallel Port Troubleshooting" HREF="x789.html"></HEAD ><BODY CLASS="CHAPTER" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >LCDproc User's Guide: The Ultimate Guide to LCDproc 0.4.3</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="x402.html" ACCESSKEY="P" ><<< Previous</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="x789.html" ACCESSKEY="N" >Next >>></A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="CHAPTER" ><H1 ><A NAME="DRIVERS" ></A >LCDproc Drivers</H1 ><P >This chapter contains the documentation of each LCDproc driver, which may include the installation process of the hardware as well as the configuration of LCDd.</P ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="HD44780-HOWTO" ></A >The HD44780 Driver</H1 ><P >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.</P ><P >The LCDproc HD44780 driver supports the following connections on a parallel port:</P ><P ></P ><UL ><LI ><P >4-bit</P ></LI ><LI ><P >8-bit (winamp style)</P ></LI ><LI ><P >extended 8-bit (LCD + LED bargraph)</P ></LI ><LI ><P >serial LPT</P ></LI ></UL ><P >And supports a PIC-an-LCD connected to a serial port.</P ><P >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.</P ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="HD44780-CONNECTIONS" ></A >Connections</H2 ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="HD44780-CONNECTIONS-COMMON" ></A >Common connections for all connectiontypes</H3 ><P >No matter what connectiontype you choose, you will always need some connections. They are explaned here.</P ><DIV CLASS="SECT4" ><H4 CLASS="SECT4" ><A NAME="HD44780-CONNECTIONS-POWER" ></A >Power</H4 ><P >All variants use the same method of obtaining power. i.e., for each LCD:</P ><DIV CLASS="TABLE" ><A NAME="AEN455" ></A ><P ><B >Table 1. HD44780: Power Connections</B ></P ><TABLE BORDER="1" BGCOLOR="#E0E0E0" CELLSPACING="0" CELLPADDING="4" CLASS="CALSTABLE" ><THEAD ><TR ><TH ALIGN="LEFT" VALIGN="TOP" >LCD</TH ><TH ALIGN="LEFT" VALIGN="TOP" >pin</TH ><TH ALIGN="LEFT" VALIGN="TOP" >signal</TH ></TR ></THEAD ><TBODY ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >1</TD ><TD ALIGN="LEFT" VALIGN="TOP" >GND</TD ><TD ALIGN="LEFT" VALIGN="TOP" >(connect to any of pins 18 - 25 of you parallel port)</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >2</TD ><TD ALIGN="LEFT" VALIGN="TOP" >+5V</TD ><TD ALIGN="LEFT" VALIGN="TOP" > </TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >3</TD ><TD ALIGN="LEFT" VALIGN="TOP" >Vadj</TD ><TD ALIGN="LEFT" VALIGN="TOP" >(contrast)</TD ></TR ></TBODY ></TABLE ></DIV ><DIV CLASS="WARNING" ><P ></P ><TABLE CLASS="WARNING" WIDTH="100%" BORDER="0" ><TR ><TD WIDTH="25" ALIGN="CENTER" VALIGN="TOP" ><IMG SRC="./stylesheet-images/warning.gif" HSPACE="5" ALT="Warning"></TD ><TD ALIGN="LEFT" VALIGN="TOP" ><P >Always double check your power connection, your display will probably NOT survive a reversely connected supply !</P ></TD ></TR ></TABLE ></DIV ><P >There are several ways to get 5V:</P ><P ></P ><UL ><LI ><P >Connect to a 5V line intented for disk drives (the red wire is 5V, black is GND).</P ></LI ><LI ><P >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.</P ></LI ><LI ><P >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...</P ></LI ><LI ><P >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.</P ></LI ></UL ><DIV CLASS="FIGURE" ><A NAME="AEN488" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > (variable resistor) .------. Vcc ---| 10k |--- GND `---^--' /|\ | Vadj. </PRE ></TD ></TR ></TABLE ><P ><B >Figure 1. HD44780: Connecting the contrast adjusting pin (Vadj.)</B ></P ></DIV ></DIV ><DIV CLASS="SECT4" ><H4 CLASS="SECT4" ><A NAME="HD44780-CONNECTIONS-KEYPAD" ></A >Keypad</H4 ><P >You can connect a keypad with all connection types. The maximum supported number of keys differs per type. There are several ways to connect the keys to the input pins.</P ><DIV CLASS="SECT5" ><H5 CLASS="SECT5" ><A NAME="HD44780-CONNECTIONS-KEYPAD-DIRECT" ></A >Direct Keys</H5 ><P >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.</P ><DIV CLASS="FIGURE" ><A NAME="AEN497" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > O 5V | | - | | 10k | | - | +-----------o input (X) | | o \ o | | === GND </PRE ></TD ></TR ></TABLE ><P ><B >Figure 2. HD44780: Direct Keys</B ></P ></DIV ><P >By default, the following keystrokes are generated by the different keys:</P ><DIV CLASS="TABLE" ><A NAME="AEN501" ></A ><P ><B >Table 2. HD44780: Default Keystrokes</B ></P ><TABLE BORDER="1" BGCOLOR="#E0E0E0" CELLSPACING="0" CELLPADDING="4" CLASS="CALSTABLE" ><TBODY ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >X0</TD ><TD ALIGN="LEFT" VALIGN="TOP" >A</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >X1</TD ><TD ALIGN="LEFT" VALIGN="TOP" >B</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >X2</TD ><TD ALIGN="LEFT" VALIGN="TOP" >C</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >X3</TD ><TD ALIGN="LEFT" VALIGN="TOP" >D</TD ></TR ></TBODY ></TABLE ></DIV ></DIV ><DIV CLASS="SECT5" ><H5 CLASS="SECT5" ><A NAME="HD44780-CONNECTIONS-KEYPAD-MATRIX" ></A >Matrix Keys</H5 ><P >Using a matrix, we can connect much more keys. To simplify the drawing here, we replace all switches with an @ symbol:</P ><DIV CLASS="FIGURE" ><A NAME="AEN520" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > X line | | Y line ---+--------- | | | o | = --@-- \ | | o | | | +---+ | | </PRE ></TD ></TR ></TABLE ><P ><B >Figure 3. HD44780: Single Matrix Key</B ></P ></DIV ><P >We connect the matrix of keys like this:</P ><DIV CLASS="FIGURE" ><A NAME="AEN524" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > Y0 o---|<---@--@--@ | | | Y1 o---|<---@--@--@ | | | Y2 o---|<---@--@--@ | | | Y3 o---|<---@--@--@ O 5V | | | | diodes | | | ___ | 1N4148 +----------|___|---+ | | | ___ | | +-------|___|---+ | | | ___ | | | +----|___|---+ resistors 22k | | | o o o X0 X1 X2 </PRE ></TD ></TR ></TABLE ><P ><B >Figure 4. HD44780: Complete Key Matrix</B ></P ></DIV ><P >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:</P ><DIV CLASS="FIGURE" ><A NAME="AEN528" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > X0 X1 X2 X3 Y0 1 2 3 A Y1 4 5 6 B Y2 7 8 9 C Y3 * 0 # D </PRE ></TD ></TR ></TABLE ><P ><B >Figure 5. HD44780: Keypad Layout</B ></P ></DIV ><P >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.</P ><P >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.</P ><P >If you want to use just one return line, for example with the serialLpt wiring, it looks (completely drawn) like this:</P ><DIV CLASS="FIGURE" ><A NAME="AEN534" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > 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 </PRE ></TD ></TR ></TABLE ><P ><B >Figure 6. HD44780: One Return Line</B ></P ></DIV ><DIV CLASS="TIP" ><P ></P ><TABLE CLASS="TIP" WIDTH="100%" BORDER="0" ><TR ><TD WIDTH="25" ALIGN="CENTER" VALIGN="TOP" ><IMG SRC="./stylesheet-images/tip.gif" HSPACE="5" ALT="Tip"></TD ><TD ALIGN="LEFT" VALIGN="TOP" ><P >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.</P ></TD ></TR ></TABLE ></DIV ></DIV ></DIV ><DIV CLASS="SECT4" ><H4 CLASS="SECT4" ><A NAME="HD44780-CONNECTIONS-BACKLIGHT" ></A >Backlight</H4 ><P >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:</P ><DIV CLASS="FIGURE" ><A NAME="AEN542" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > 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 </PRE ></TD ></TR ></TABLE ><P ><B >Figure 7. HD44780: Backlight Wiring</B ></P ></DIV ><DIV CLASS="CAUTION" ><P ></P ><TABLE CLASS="CAUTION" WIDTH="100%" BORDER="0" ><TR ><TD WIDTH="25" ALIGN="CENTER" VALIGN="TOP" ><IMG SRC="./stylesheet-images/caution.gif" HSPACE="5" ALT="Caution"></TD ><TD ALIGN="LEFT" VALIGN="TOP" ><P >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).</P ></TD ></TR ></TABLE ></DIV ><DIV CLASS="TIP" ><P ></P ><TABLE CLASS="TIP" WIDTH="100%" BORDER="0" ><TR ><TD WIDTH="25" ALIGN="CENTER" VALIGN="TOP" ><IMG SRC="./stylesheet-images/tip.gif" HSPACE="5" ALT="Tip"></TD ><TD ALIGN="LEFT" VALIGN="TOP" ><P >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.)</P ></TD ></TR ></TABLE ></DIV ></DIV ></DIV ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="HD44780-4-BIT" ></A >4-bit</H3 ><P >This is originally based on "lcdtext" (by Matthias Prinke).</P ><DIV CLASS="TABLE" ><A NAME="AEN552" ></A ><P ><B >Table 3. HD44780: 4-bit Pinouts (1)</B ></P ><TABLE BORDER="1" BGCOLOR="#E0E0E0" CELLSPACING="0" CELLPADDING="4" CLASS="CALSTABLE" ><THEAD ><TR ><TH ALIGN="LEFT" VALIGN="TOP" >printer port</TH ><TH ALIGN="LEFT" VALIGN="TOP" >LCD</TH ></TR ></THEAD ><TBODY ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >D0 (2)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >D4 (11)</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >D1 (3)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >D5 (12)</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >D2 (4)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >D6 (13)</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >D3 (5)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >D7 (14)</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >D4 (6)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >RS (4)</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >D5 (7)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >RW (5) (LCD3 - 6) (optional - pull all LCD RW low)</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >D6 (8)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >EN (6)</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >D7 (9)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >EN2 (LCD2 - 6) (optional)</TD ></TR ></TBODY ></TABLE ></DIV ><P >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:</P ><DIV CLASS="TABLE" ><A NAME="AEN585" ></A ><P ><B >Table 4. HD44780: 4-bit Pinouts (2)</B ></P ><TABLE BORDER="1" BGCOLOR="#E0E0E0" CELLSPACING="0" CELLPADDING="4" CLASS="CALSTABLE" ><THEAD ><TR ><TH ALIGN="LEFT" VALIGN="TOP" >printer port</TH ><TH ALIGN="LEFT" VALIGN="TOP" >LCD</TH ></TR ></THEAD ><TBODY ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >STR (1)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >EN4</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >LF (14)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >EN5</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >INIT (16)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >EN6</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >SEL (17)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >EN7</TD ></TR ></TBODY ></TABLE ></DIV ><P >The optional keypad can be connected as follows:</P ><DIV CLASS="TABLE" ><A NAME="AEN606" ></A ><P ><B >Table 5. HD44780: 4-bit Keypad Pinouts</B ></P ><TABLE BORDER="1" BGCOLOR="#E0E0E0" CELLSPACING="0" CELLPADDING="4" CLASS="CALSTABLE" ><THEAD ><TR ><TH ALIGN="LEFT" VALIGN="TOP" >printer port</TH ><TH ALIGN="LEFT" VALIGN="TOP" >LCD</TH ></TR ></THEAD ><TBODY ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >D0 (2)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >Y0</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >D1 (3)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >Y1</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >D2 (4)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >Y2</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >D3 (5)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >Y3</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >D4 (6)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >Y4</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >D5 (7)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >Y5</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >nSTRB (1)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >Y6</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >nLF (14)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >Y7</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >INIT (16)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >Y8</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >nSEL (17)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >Y9</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" > </TD ><TD ALIGN="LEFT" VALIGN="TOP" > </TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >nACK (10)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >X0</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >BUSY (11)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >X1</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >PAPEREND (12)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >X2</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >SELIN (13)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >X3</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >nFAULT (15)</TD ><TD ALIGN="LEFT" VALIGN="TOP" >X4</TD ></TR ></TBODY ></TABLE ></DIV ><P >The optional backlight wiring should be connected to D5, pin 7.</P ></DIV ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="HD44780-8-BIT-WINAMP" ></A >8-bit "Winamp"</H3 ><P >This type of connection should work with winamp.</P ><DIV CLASS="FIGURE" ><A NAME="AEN666" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > printer port LCD D0 (2) D0 (7) D1 (3) D1 (8) D2 (4) D2 (9) D3 (5) D3 (10) D4 (6) D4 (11) D5 (7) D5 (12) D6 (8) D6 (13) D7 (9) D7 (14) nSTRB (1) EN (6) nLF (14) nRW (5) (EN3 6 - LCD 3) (optional) INIT (16) RS (4) nSEL (17) EN2 (6 - LCD 2) (optional) </PRE ></TD ></TR ></TABLE ><P ><B >Figure 8. HD44780: "Winamp" wiring</B ></P ></DIV ><P >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.</P ><P >The optional keypad can be connected as follows:</P ><DIV CLASS="FIGURE" ><A NAME="AEN671" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > printer port keypad 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 </PRE ></TD ></TR ></TABLE ><P ><B >Figure 9. HD44780: "Winamp" wiring - Keypad</B ></P ></DIV ><P >The optional backlight wiring should be connected to nSEL, pin 17.</P ></DIV ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="HD44780-8-BIT-LCDTIME" ></A >8-bit "lcdtime"</H3 ><P >This is originally based on "lcdtime" (by Benjamin Tse <TT CLASS="EMAIL" ><<A HREF="mailto:blt@ComPorts.com" >blt@ComPorts.com</A >></TT >) 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:</P ><P ><A HREF="http://metalab.unc.edu/pub/linux/system/status/lcdtime-0.2.tar.gz" TARGET="_top" >http://metalab.unc.edu/pub/linux/system/status/lcdtime-0.2.tar.gz</A > <A HREF="http://metalab.unc.edu/pub/linux/system/status/meter-0.2.tar.gz" TARGET="_top" >http://metalab.unc.edu/pub/linux/system/status/meter-0.2.tar.gz</A > <A HREF="http://metalab.unc.edu/pub/linux/system/status/portato-1.2.tar.gz" TARGET="_top" >http://metalab.unc.edu/pub/linux/system/status/portato-1.2.tar.gz</A ></P ><DIV CLASS="NOTE" ><P ></P ><TABLE CLASS="NOTE" WIDTH="100%" BORDER="0" ><TR ><TD WIDTH="25" ALIGN="CENTER" VALIGN="TOP" ><IMG SRC="./stylesheet-images/note.gif" HSPACE="5" ALT="Note"></TD ><TD ALIGN="LEFT" VALIGN="TOP" ><P >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.</P ></TD ></TR ></TABLE ></DIV ><P >The LCD connections are:</P ><DIV CLASS="FIGURE" ><A NAME="AEN686" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > printer port LCD D0 (2) D0 (7) D1 (3) D1 (8) D2 (4) D2 (9) D3 (5) D3 (10) D4 (6) D4 (11) D5 (7) D5 (12) D6 (8) D6 (13) D7 (9) D7 (14) nSEL (17) - nSTRB (1) RS (4) nLF (14) RW (5) (LCD2 - 6) (optional - pull all LCD RW low) INIT (16) EN (6) </PRE ></TD ></TR ></TABLE ><P ><B >Figure 10. HD44780: "lcdtime" wiring</B ></P ></DIV ><P >See the lcdtime tar-ball (above) for full details of the bargraph connections.</P ><P >The optional keypad can be connected as follows:</P ><DIV CLASS="FIGURE" ><A NAME="AEN691" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > printer port keypad 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 </PRE ></TD ></TR ></TABLE ><P ><B >Figure 11. HD44780: "lcdtime" wiring - keypad</B ></P ></DIV ><P >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.</P ></DIV ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="HD44780-SERIALLPT" ></A >Serial LPT</H3 ><P >This interface uses a handful of wires to interface to the HD44780. Suitable for high noise, long connections. Designed by Andrew McMeikan <TT CLASS="EMAIL" ><<A HREF="mailto:andrewm@engineer.com" >andrewm@engineer.com</A >></TT >. The original wiring and driver can be found at:</P ><P ><A HREF="http://members.xoom.com/andrewmuck" TARGET="_top" >http://members.xoom.com/andrewmuck</A ></P ><P >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).</P ><P >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 ! :)</P ><P >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.</P ><P >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.</P ><DIV CLASS="FIGURE" ><A NAME="AEN705" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > IC1 ----------- | 4094 | 5V | shift reg | display O | | /keys | 1| |3 +----|STR Q0|---------------------o 7 D0 | | |4 /Y0 Data | 2| Q1|---------------------o 8 D1 D3 5 o---------------------------|D |5 /Y1 | | Q2|---------------------o 9 D2 | 3|CK |6 /Y2 D4 6 o---------------------------| Q3|---------------------o 10 D3 | | |10 /Y3 | 15| Q4|---------------------o Y4 +----|OE |11 | Q5|---------------------o 4 RS | |12 /Y5 | Q6|---------------------o Y6 | |13 | 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 </PRE ></TD ></TR ></TABLE ><P ><B >Figure 12. HD44780: Serial LPT wiring ('simple')</B ></P ></DIV ><P >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.</P ><DIV CLASS="FIGURE" ><A NAME="AEN709" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > IC2 ----------- | 74HCT164 | | shift reg | display | | /keys Data 1| |3 D3 5 o-----------------------+---|D Q0|---------------------o 7 D0 | | |4 /Y0 | 2| Q1|---------------------o 8 D1 +---|D |5 /Y1 | Q2|---------------------o 9 D2 | |6 /Y2 | Q3|---------------------o 10 D3 | |10 /Y3 Clock 8| Q4|---------------------o Y4 D4 6 o---------------------------|CK |11 | Q5|---------------------o 4 RS ___ 9|\ 8 9|_ |12 /Y5 +--|___|--+----| >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 </PRE ></TD ></TR ></TABLE ><P ><B >Figure 13. HD44780: Serial LPT wiring ('complex')</B ></P ></DIV ><DIV CLASS="SECT4" ><H4 CLASS="SECT4" ><A NAME="HD44780-SERIALLPT-KEYPAD" ></A >Serial LPT Keypad</H4 ><DIV CLASS="NOTE" ><P ></P ><TABLE CLASS="NOTE" WIDTH="100%" BORDER="0" ><TR ><TD WIDTH="25" ALIGN="CENTER" VALIGN="TOP" ><IMG SRC="./stylesheet-images/note.gif" HSPACE="5" ALT="Note"></TD ><TD ALIGN="LEFT" VALIGN="TOP" ><P >To understand this part of the serialLpt documentation, you also need to read the <A HREF="c429.html#HD44780-CONNECTIONS-KEYPAD" >keypad section</A > in this document.</P ></TD ></TR ></TABLE ></DIV ><P >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.</P ><DIV CLASS="FIGURE" ><A NAME="AEN718" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > nACK (10) X0 BUSY (11) X1 PAPEREND (12) X2 SELIN (13) X3 nFAULT (15) X4 </PRE ></TD ></TR ></TABLE ><P ><B >Figure 14. HD44780: Serial LPT - Keypad return lines</B ></P ></DIV ><P >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:</P ><DIV CLASS="FIGURE" ><A NAME="AEN722" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > 1|\ 2 13|\ 12 ___ keypad o-----| >o------| >o---|___|---+---o input pin on LPT port return |/ |/ 220E | IC1 IC1 --- --- 1nF | === </PRE ></TD ></TR ></TABLE ><P ><B >Figure 15. HD44780: Serial LPT - Keypad return lines buffered</B ></P ></DIV ></DIV ><DIV CLASS="SECT4" ><H4 CLASS="SECT4" ><A NAME="HD44780-SERIALLPT-BACKLIGHT" ></A >Serial LPT Backlight</H4 ><P >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 <A HREF="c429.html#HD44780-CONNECTIONS-BACKLIGHT" >backlight section</A ></P ><DIV CLASS="FIGURE" ><A NAME="AEN729" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="SCREEN" > ___ 3|\ 4 Data o-----|___|--+----| >o----o BL output LPT-D3 470k | |/ --- IC1 --- |100nF | === </PRE ></TD ></TR ></TABLE ><P ><B >Figure 16. HD44780: Serial LPT - Backlight extra circuit</B ></P ></DIV ></DIV ></DIV ><DIV CLASS="SECT3" ><H3 CLASS="SECT3" ><A NAME="HD44780-PICANLCD" ></A >PIC-an-LCD serial device "picanlcd"</H3 ><P >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.</P ></DIV ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="HD44780-COMPILING" ></A >Compiling</H2 ><P >Make sure that the HD44780 files are built when you run configure. This can be done by specifying "--enable-drivers=all" or by "--enable-drivers=hd44780".</P ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="HD44780-CONFIGURATION" ></A >Configuration</H2 ><P >Since LCDproc 0.4.3 the HD44780 driver can be cnfigured from the configfile.</P ><P >The [HD44780] section is more or less self-explanatory. Yet, a list of the possible connection types has proved useful. The following table should make it clear, how the ConnectionType is to be set.</P ><DIV CLASS="TABLE" ><A NAME="AEN742" ></A ><P ><B >Table 6. HD44780: Connection Types</B ></P ><TABLE BORDER="1" BGCOLOR="#E0E0E0" CELLSPACING="0" CELLPADDING="4" CLASS="CALSTABLE" ><THEAD ><TR ><TH ALIGN="LEFT" VALIGN="TOP" >Wiring / Display Type</TH ><TH ALIGN="LEFT" VALIGN="TOP" >ConnectionType=</TH ></TR ></THEAD ><TBODY ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >HD44780 4bit Wiring</TD ><TD ALIGN="LEFT" VALIGN="TOP" >4bit</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >HD44780 8bit Wiring ("lcdtime")</TD ><TD ALIGN="LEFT" VALIGN="TOP" >8bit</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >HD44780 Serial LPT Wiring</TD ><TD ALIGN="LEFT" VALIGN="TOP" >serialLpt</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >HD44780 8bit Wiring "winamp" Style</TD ><TD ALIGN="LEFT" VALIGN="TOP" >winamp</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="TOP" >PIC-an-LCD serial device "picanlcd"</TD ><TD ALIGN="LEFT" VALIGN="TOP" >picanlcd</TD ></TR ></TBODY ></TABLE ></DIV ><DIV CLASS="TIP" ><P ></P ><TABLE CLASS="TIP" WIDTH="100%" BORDER="0" ><TR ><TD WIDTH="25" ALIGN="CENTER" VALIGN="TOP" ><IMG SRC="./stylesheet-images/tip.gif" HSPACE="5" ALT="Tip"></TD ><TD ALIGN="LEFT" VALIGN="TOP" ><P >The above table might be outdated, when you read this. If you suspect this is the case, you might want to have a look at server/drivers/hd44780-drivers.h which contains the actual translation code.</P ></TD ></TR ></TABLE ></DIV ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="HD44780-RUNNING" ></A >Running</H2 ><P >Modify the LCDd.conf file before you run LCDd. In this config file are detailed instructions on how to configure the HD44780 driver.</P ><P >Then as usual, start LCDd with the correct config file:</P ><P >E.g. <B CLASS="COMMAND" >LCDd -c ./LCDd.conf</B ></P ><P >If you want to override the driver selection in LCDd.conf then use:</P ><P ><B CLASS="COMMAND" >LCDd -c ./LCDd.conf -d HD44780</B ></P ><P >If you use this, the HD44780 driver will read the options from the config file anyway.</P ></DIV ><DIV CLASS="SECT2" ><H2 CLASS="SECT2" ><A NAME="HD44780-MISCELLANIA" ></A >Miscellania</H2 ><P >This text has originally been taken from a message by Bill Farrow <TT CLASS="EMAIL" ><<A HREF="mailto:bfarrow@arrow.bsee.swin.edu.au" >bfarrow@arrow.bsee.swin.edu.au</A >></TT >.</P ><P >Updated February 2000, Benjamin Tse <TT CLASS="EMAIL" ><<A HREF="mailto:blt@ComPorts.com" >blt@ComPorts.com</A >></TT ></P ><P >Updated October 2001, Joris Robijn <TT CLASS="EMAIL" ><<A HREF="mailto:joris@robijn.net" >joris@robijn.net</A >></TT ></P ><P >Converted to docbook March 2002, Rene Wagner <TT CLASS="EMAIL" ><<A HREF="mailto:reenoo@gmx.de" >reenoo@gmx.de</A >></TT ></P ><P >Updated April 2002, Rene Wagner <TT CLASS="EMAIL" ><<A HREF="mailto:reenoo@gmx.de" >reenoo@gmx.de</A >></TT ></P ></DIV ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="x402.html" ACCESSKEY="P" ><<< Previous</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="book1.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="x789.html" ACCESSKEY="N" >Next >>></A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >The LCDproc Init Scripts</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" > </TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Parallel Port Troubleshooting</TD ></TR ></TABLE ></DIV ></BODY ></HTML >