]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2000-04-17 05:14:27 by reinelt]
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Mon, 17 Apr 2000 05:14:27 +0000 (05:14 +0000)
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Mon, 17 Apr 2000 05:14:27 +0000 (05:14 +0000)
added README.44780

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@48 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

README.HD44780 [new file with mode: 0644]
lcd4linux.c
lcd4linux.conf.sample

diff --git a/README.HD44780 b/README.HD44780
new file mode 100644 (file)
index 0000000..8fc87d4
--- /dev/null
@@ -0,0 +1,96 @@
+#
+# $Id: README.HD44780,v 1.1 2000/04/17 05:14:27 reinelt Exp $
+#
+
+This is the README file for the HD44780 display driver for lcd4linux
+
+This driver supports all display modules based on the Hitachi HD44780 chip.
+These displays are made by different manufactures, and come in various sizes.
+
+The following types are known to work:
+
+DataVision DV16244: 2 lines by 16 characters
+           PM0820A: 2 lines by  8 characters 
+
+The displays are connected to the parallel board (see Wiring below), and are quite timing-critical.
+There's no way to delay a usermode program under Linux for e.g. 40 usec, so we have to do 
+busy-waiting. This is done in a delay loop, which has to be calibrated (see Configuration below).
+
+The driver supports vertical, horizontal and split bars (two independent bars in one line),
+all bar types can be used simultanously. As the displays only have 8 user-defined characters,
+the needed characters to display all the bars must be reduced to 8. This is done by replacing
+characters with similar ones. To reduce flicker, a character which is displayed at the moment,
+will not be redefined, even if it's not used in this run. Only if the character compaction 
+fails, this characters will be redefined, too.
+
+
+Configuration:
+
+The driver needs the following entries in lcd4linux.conf:
+
+Display: HD44780
+Port: the hexadecimal address of the parallel port (e.g. 0x378)
+Size: [columns]x[rows] e.g. "16x2"
+Delay: calibration of the delay loop, loops per microsecond
+
+It is very important to use a correct delay value, otherwise you will get only junk on the
+display. lcd4linux has a switch '-d' where it helps you to find the correct value. Run
+'lcd4linux -d' several times on a otherwise idle machine, and use the maximum value. If you
+encounter display problems, increase this value. But don't take it too big, lcd4linux will get
+slow, and you're burning CPU cycles.
+
+The delay value is defined by your CPU model and clock frequency (it looks like it's your 
+'BogoMips' value divided by 2, because we use a similar delay loop than the kernel does). 
+Here are some examples:
+
+Pentium MMX, 133 MHz, 106 BogoMips:   54
+Pentium MMX, 166 MHz, 333 BogoMips:  166
+Celeron,     333 MHz, 333 BogoMips:  166
+Pentium III, 600 MHz, 600 BogoMips:  300
+
+
+Wiring:
+
+There are two basic wiring modes for HD44780-Displays: a 4 bit mode (used by lcdproc) and a 
+8 bit mode (used by most other packages). At the moment we only support the 8 bit mode, but
+I'm working on the 4 bit mode, too.
+
+The main difference is that the 8 bit mode transfers one byte at a time, but the HD44780 needs 
+some control signals, so some of the parallel port control lines are used for this. The 4 bit
+mode uses only 4 bits for data (so a byte has to be transferred in two cycles), but you can use 
+the other 4 bits for the control signals.
+
+Normally a HD44780-based display have 14 or 16 pins, where pins 15 and 16 are used for backlight.
+Power (+5V) must be supplied via pins 1 and 2, be careful not to change polarity, you will 
+destroy your display! Pin 3 is used to control the contrast, you can either hardwire it to GND
+(pin 1) or place a potentiometer (10k-20k) between pins 1 and 2, and connect pin 3 to the slider.
+
+Note that the data bits are called DB0..DB7 on the display, but DB1..DB8 on the parallel port!
+
+Here comes the wiring diagram for the 8 bit mode:
+
+--- Display ---        --- DB25 ---            --- comment ---
+Name        Pin        Pin     Name
+
+GND           1        18      GND             GND of power supply, too!
++5V           2        -                       power supply only
+LCD drive     3        -                       see above
+RS            4        14      Auto Feed       register select, 0=data, 1=command
+R/W           5        18      GND             hardwired to 0, write data only
+Enable        6         1      Strobe          toggled when data is valid
+DB0           7         2      DB1             data bit 0
+DB1           8         3      DB2             data bit 1
+DB2           9         4      DB3             data bit 2
+DB3          10         5      DB4             data bit 3
+DB4          11         6      DB5             data bit 4
+DB5          12         7      DB6             data bit 5
+DB6          13         8      DB7             data bit 6
+DB7          14         9      DB8             data bit 7
++5V          15         -                      power for backlight
+GND          16         -                      power for backlight
+                        10-13  not connected
+                        15-17  not connected
+                        19-25  not connected
+
+
+Wiring diagram for 4 bit mode: soon to come!
index 75b195a1fe5d993b4dc934f11e9a028768371175..0e823825611b308b979b0966d3981c8eb32acbc8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: lcd4linux.c,v 1.22 2000/04/15 16:56:52 reinelt Exp $
+/* $Id: lcd4linux.c,v 1.23 2000/04/17 05:14:27 reinelt Exp $
  *
  * LCD4Linux
  *
  *
  *
  * $Log: lcd4linux.c,v $
+ * Revision 1.23  2000/04/17 05:14:27  reinelt
+ *
+ * added README.44780
+ *
  * Revision 1.22  2000/04/15 16:56:52  reinelt
  *
  * moved delay loops to udelay.c
@@ -189,6 +193,22 @@ int lcd_hello (void)
   return flag;
 }
 
+void calibrate (void)
+{
+  int i;
+  unsigned long max=0;
+
+  printf ("%s\n", release);
+  printf ("calibrating delay loop:");
+  fflush(stdout);
+  for (i=0; i<10; i++) {
+    udelay_calibrate();
+    if (loops_per_usec>max)
+      max=loops_per_usec;
+  }
+  printf (" Delay=%ld\n", max);
+}
+
 int main (int argc, char *argv[])
 {
   char *cfg="/etc/lcd4linux.conf";
@@ -205,9 +225,7 @@ int main (int argc, char *argv[])
       }
       break;
     case 'd':
-      printf ("%s\n", release);
-      udelay_calibrate();
-      printf ("calibrating delay loop: Delay=%ld\n", loops_per_usec);
+      calibrate();
       exit(0);
     case 'h':
       usage();
index dba2ced061e912ad130c0d82483ab2a577283cf0..e693c67284633f588d6111fb31f53c9829b83629 100644 (file)
@@ -6,7 +6,7 @@
 Display HD44780
 Port 0x378
 Size 16x2
-Delay 600
+Delay 300
 
 #Display PPM
 #size 20x4