HD44780 update:

- supports new API
- major clean up, more consistent code
- uses configfile options
- serialLpt works also with only 2 output lines
- serialLpt can now use keypad
This commit is contained in:
robijn
2001-11-01 00:37:12 +00:00
parent 0619f03774
commit faa4861eb3
9 changed files with 786 additions and 494 deletions
+207 -30
View File
@@ -79,7 +79,7 @@ to the input pins.
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.
+ 5V
O 5V
|
|
-
@@ -136,7 +136,7 @@ Y1 o---|<---@--@--@
| | |
Y2 o---|<---@--@--@
| | |
Y3 o---|<---@--@--@ + 5V
Y3 o---|<---@--@--@ O 5V
| | | |
diodes | | | ___ |
1N4148 +----------|___|---+
@@ -168,6 +168,54 @@ 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 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.
1.1.3 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:
O 5V
___ |
+---|___|--------+
LPT Sub-D connector | 4k7 |
| |e
| ___ b |/
BL pin o---------------+---|___|------|
330E |\
bc327 |c
| LCD connector
|
+--------o 15 backlight
+--------o 16 GND backlight
|
=== GND
Note: 4k7 means 4,7 kohm and 330E means 330 ohm.
The BC327 has the following connections:
_____
| |
|bc327|
|_____|
| | |
| | |
| | |
c b e
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 add a resistor after
the transistor of 10 ohm.
1.2 4-bit
----------
@@ -219,6 +267,8 @@ The optional keypad can be connected as follows:
SELIN (13) X3
nFAULT (15) X4
The optional backlight wiring should be connected to D5, pin 7.
1.3 8-bit "Winamp"
-------------------
@@ -267,6 +317,8 @@ The optional keypad can be connected as follows:
SELIN (13) X3
nFAULT (15) X4
The optional backlight wiring should be connected to nSEL, pin 17.
1.4 Extended 8-bit "lcdtime"
-----------------------------
@@ -280,6 +332,9 @@ 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
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:
printer port LCD
@@ -321,16 +376,153 @@ The optional keypad can be connected as follows:
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.
1.5 Serial LPT
---------------
This interface uses a handful of wires to interface to the
HD44780. Suitable for high noise, long connections. Designed by
Andrew McMeikan <andrewm@engineer.com>. Refer to
http://members.xoom.com/andrewmuck for details of the connections.
Andrew McMeikan <andrewm@engineer.com>. The original wiring and
driver can be found at:
http://members.xoom.com/andrewmuck
Note from Joris: I still need to add keypad stuff here
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.
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
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.
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
Also the 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.
The return lines are the following:
nACK (10) X0
BUSY (11) X1
PAPEREND (12) X2
SELIN (13) X3
nFAULT (15) X4
To understand some of this keypad documentation, do also read the keypad
section in this document.
2. Compiling
@@ -344,33 +536,17 @@ can be done by specifying "--enable-drivers=all" or by
3. Running
----------
Keep in mind the following points.
Modify the LCDd.conf file before you run LCDd. In this config file are
detailed instructions on how to configure the HD44780 driver.
- When specifying the lcd size, do so before the -d argument.
- Arguments that need to be passed to the driver should be in quotes after
the -d HD44780 arguments.
- Use the "-e" argument for extended interfaces (e.g. 3 or more displays as
indicated by "optional" connections above).
- Use "-k" to enable the keypad code.
Then as usual, start LCDd with the correct config file:
LCDd -c ./LCDd.conf
for example.
EXAMPLES:
For a 4bit connection, 16x2 display on port 0x278
LCDd -t 16x2 -d HD44780 "-p 0x278"
For a 4bit, 40x4 display (effectively two 40x2 displays)
LCDd -t 40x4 -d HD44780 "-v 2,2"
For a Winamp connection, 20x2 and 20x1 displays
LCDd -t 20x3 -d HD44780 "-c winamp -v 2,1"
For a 4bit, 16x2, 16x4 and 16x1 displays
LCDd -t 16x7 -d HD44780 "-v 2,4,1 -e"
For help on the parameters for the 8-bit driver (make sure --help is the
last arguments in quotes):
LCDd -d HD44780 "-c 8bit --help"
If you want to override the driver selection in LCDd.conf then use:
LCDd -c ./LCDd.conf -d HD44780
If you use this, the HD44780 driver will read the options from the config
file.
4. Miscellania
@@ -381,3 +557,4 @@ This text originally taken from a message by Bill Farrow
Updated February 2000, Benjamin Tse (blt@ComPorts.com)
Updated October 2001, Joris Robijn (joris at robijn.net)