PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Probleme mit Lcd unter Suse8.0



logan
10.08.02, 23:28
Hallöchen!

Ich bin Linuxneuling und habe folgendes Problem! Und Zwar hab ich mir mal bei Ebay so ein fertig zusammengebasteltes Lcd (4x20) Gekauft! Welches auch unter Windows Problemlos lief! Nur unter Linux bzw. Suse 8.0 weiss ich nicht mehr weiter! Ich hab mir mal das Proc (lcdmod-6.0.2) gesaugt und Entpackt wenn ich jetzt allerdings als SU auf die Konsole wechsel und folgenden pfad eingebe linux:/home/logan/LCD/lcdmod-6.0.2/examples # ./display_date.sh kommt folgende Meldung ./display_date.sh: /dev/lcd: Kein passendes Gerät gefunden! Im Bios ist der Parallelport noch genauso eingestellt wie unter Windows! Kann mir vielleicht einer von euch helfen? Besten Dank schonmal in Voraus!




Logan

geronet
11.08.02, 09:23
Ich zeig dir mal ne Anleitung.. ich hab auch so ein LCD ;))











Hardware
--------
This is for a 20 x 4 character LCD display based on the Hitachi HD44780
controller. Additional displays with other geometries should be suppported by
setting LCD_COLS and LCD_LINES correctly. The display can easily be wired to
a standard PC parallel port. Just connect the eight data bits to the eight
inputs of the display plus STROBE (pin 1 on 25 pin Sub-D) to EN (enable) and
FEED (pin 14 on 25 pin Sub-D) to RS (command-/datamode). You will also have
to connect GND to the read/write selector input. The driver does not need to
read from the display so we can hard-wire the write mode. Don't forget to add
at least one GND line. The +5V power supply for the display can easily be
obtained from a game-port adapter or drive power supply connector.

25 pin LCD
SUB D Panel Pin
---------------------------
18-25 GND --+
GND 1 --+--- \ Connect to
+5V 2 --|--- / Gameport
R/W 5 --+
1 EN 6
2 DB1 7
3 DB2 8
4 DB3 9
5 DB4 10
6 DB5 11
7 DB6 12
8 DB7 13
9 DB8 14
14 RS 4

Pin 3 on the LCD is the LCD driver control voltage input, i.e. contrast
regulation. My display shows very good contrast when wired directly to
GND. Other display may need a real driver current. You can use a
variable resistor (>= 20 kOhm) to do it like this

+5V ---+
/
\ <--+
/ |
\ |
GND ---+ +--- VL (Pin 3 - driver input)

The PC game port offers several +5V lines that can be used as power supply.
You can use
DB15 pins 1,8,9 or 15 for +5V
4,5 or 12 for GND

But please try to verify this for your hardware because some soundcards may
carry additional signals like a Midi port on those lines.
A floppy or harddisk power connector serves also as power supply. Here use
the red wire (+5V) and the black wire (GND). CAUTION: The yellow wire
carries +12V which would toast your display immediately and may also damage
your parallel port!


Installation / compilation
--------------------------
Choose the correct definition for Kernel 2.0.* or Kernel 2.1.* (use
-DKERNEL21 for Kernel 2.2.* too). For kernel 2.4 set this to
-DKERNEL21 -DKERNEL24

Now just type 'make' to build the module.

Create a character device major 120 minor 0, you may choose to use the
included script 'mkdevice' for this which creates /dev/lcd.

'insmod' the module without any options if you want the defaults:
I/O address 0x378 (first parallel port on most PCs)
Columns 20
Lines 4
Short timing 40
Long timing 100
Addressing type 0 (HD44780 and compatible controllers)

You can override them with these parameters:
io for io_address of the parallel port
cols for number of columns: Only 16,20,32 and 40 are valid
lines for number of lines: Only 1,2 and 4 are valid
t_short Short Display Timing. Standard is: 40
t_long Long Display Timing. Standard is: 100
a_type Addressing type. Standard is: 0. Possible values are 0 for standard
HD44780 controller types and 1 for HD66712 controllers.

The device is initialized (set initial mode, clear display, turn display on)
when the driver module is inserted. You should see an underline cursor not
blinking in the upper left corner.

Now just write text to the device, done ;)
German "Umlaut" characters are mapped correctly. Additional mappings can be
done in "c_table.h".

Valid ESC commands:
ESC c - Clear display
ESC h - Home cursor
ESC R - Reset display
ESC b - Cursor on and blinking
ESC B - Cursor on, not blinking
ESC k - Cursor on, not blinking
ESC K - Cursor off
ESC # - Define user definable char number # (characters #0 to #7)


Defining a character:
---------------------
Characters are organized in 8 bits per row (!) with the three most
significant bits ignored for displays with 5x7 fonts and 8 rows per
character. Some displays can also use 5x8 fonts, i.e. the characters may use
the cursor line. A character is defined as follows:

D7----D0
0 00011111 = 16 + 8 + 4 + 2 + 1 = 31
1 00010000 = 16
2 00010001 = 16 + 1 = 17
3 00011111 = 16 + 8 + 4 + 2 + 1 = 31
4 00010001 = 16 + 1 = 17
5 00010000 = 16
6 00010000 = 16
7 00000000 = 0

which creates something similar to a big F.
To define this character as char number 0 you will have to write the sequence

27 0 31 16 17 31 17 16 16 0

to the LCD device (which is ESC-0-31-16-17-31-17-16-16-0).
You can do this from your shell using the echo command with the "-e" switch
like in
echo -n -e "\33\0\37\20\21\37\21\20\20\0" > /dev/lcd
A subsequent
echo -n -e "\0" > /dev/lcd
will print the new character. The "-n" just suppresses a trailing line-feed.


Terminal-like behaviour:
------------------------
If during the cursor reaches the right most character during a write the
cursor is positioned at the beginning of the next line.

Line-feed character (dec 10) causes the cursor to move to the beginning of
the next line.

Carriage-return (dec 13) causes the cursor to move to the beginning of the
current line.


Further installation
--------------------
If you use something like kerneld, i.e. automatically loading modules when
needed, you might want to copy the driver 'lcd.o' to your modules directory
and add the following line to your 'conf.modules'

alias char-major-120 lcd

After that update your module's dependencies by doing 'depmod -a' and the
module should load automatically when /dev/lcd is accessed.


Testing
-------
You should have received some test programs with this package. After the
display is installed and the module is inserted correctly you should be able
to run them and see the output.
test/
type 'make' to build a program 'dtest'
running './dtest' will at first display a sequence of "12345..." in
every line so you can count the number of characters ;) After pressing
a key the whole font is displayed filling the whole screen with one
character each and going through all characters >=32.
tools/scripts/
nice - prints date, time and system-load every ten seconds,
a simple demo for a shell script
tools/defchars/
horbars - simple shell script that defines horizontal bargraph
characters
vertbars - simple shell script that defines vertical bargraph
characters
printchars - simple shell script that prints the eight user definable
characters
tools/proclcd/
proclcd - C program to print date, time and system load on the display
(if you want something like this use 'proclcd' not 'nice')


Usual blah-blah
---------------
This driver is incomplete and may crash your machine.
Wrong wiring may also cause severe damage to the display and to your
computer. There is also no expressed or implied waranty that it will work with
your display your computer or both.

The driver is free software but
(c) Siegen (Germany) 1998,1999,2000 by Nils Faerber
with changes by Juergen Bauer in August/September 2000
GNU Public License Version 2 or later applies


Thanks go to:
Michael Engel - for getting me started with driver programming
Graham Stoney - for testing another display and a small fix
Juergen Bauer - new module parameters instead of hardware.h,
some clean-ups









Diesen Treiber bekommst du bei http://www.unix-ag.uni-siegen.de/~nils/lcd.html







Grüsse, Stefan

logan
11.08.02, 11:14
Hallo Stefan!

Also wenn ich das recht verstehe soll mir die Anleitung sagen das ich eine andere Pin-Belegung Brauche?


MfG
Christoph

geronet
11.08.02, 11:20
Das auch ja:





Pin 5 LCD kommt auf Masse (18).


Pin 4 LCD kommt auf Pin 14 (Parallelport) und nicht auf Pin 16.





Grüsse, Stefan, der gerade eben die Parallelport-ISA-Karte im Rechner für sein LCD umbaut *g*

logan
11.08.02, 11:27
Also muss ich das Kabel welches an Pin 5 Am Parallelport ist auf Pin 18 umlöten und und Pin 4 auf Pin 14? Und was hab ich dann noch zu beachten? Weil du schreibst das auch?


MfG
Christoph

KeyMan
11.08.02, 11:43
hallo.
ich haben mal einen "konverter" dafür gebaut...schließlich ist das lcd vopm stefan von mir :)
ist so ein LCD-durchreiche teil wo ne menge kabel gelötet werden müssen, rausgefunden hab ichs damals mit nem besseren teil (steckvorrichtung)
wir 2 sind nämlich lcd-fanatiker wie es scheint :)

also wenn du die GENAUEN belegungen wissen willst sag es, denn ich hab bei meinem LCD nen umschaltbares teil gebaut um es von windoof auf linux zu switchen usw.....
MfG
key

logan
11.08.02, 11:47
ja gib mal bitte!
Kannste mir ja mailen hifimax@gmx.de


MfG
Christoph

slime
11.08.02, 11:49
du kannst auch in dem treiber die belegung ändern!

/*
* LCD pins and functions
*/
/* control bits */
#define LCD_RS 0x02
#define LCD_EN 0x01
/* functions (RS==1) */
#define LCD_CLEAR 0x01
#define LCD_HOME 0x02
#define LCD_MODESET 0x04
#define LCD_ONOFF 0x08
#define LCD_EXTFUNC 0x08 /* RE must be set to 1 using LCD_FUNCSET */
#define LCD_SHIFT 0x10
#define LCD_SCRL_EN 0x10 /* RE == 1 */
#define LCD_FUNCSET 0x20
#define LCD_SETCGRAM 0x40
#define LCD_SETSEGRAM 0x40 /* RE == 1 */
#define LCD_SETDDRAM 0x80
#define LCD_SETSCRL 0x80 /* RE == 1 */


das sind die daten die in dem treiber stehen. sie repräsentieren die belegung am parallelport.
musst du nur passend anpassen. ich hab beim löten meines lcd's auch einen fehler gemacht und hab dan einfach den treiber angepasst.

logan
11.08.02, 12:01
@Slime


Kannste mir dann auch sagen was ich ändern muss? Wie gesagt bin Linuxneuling!


MfG
Christoph

slime
11.08.02, 12:26
ich hab bei mir einfach das geändert.

#define LCD_RS 0x04
#define LCD_EN 0x02

aber das kommt auf die hardware an, ich weiß ja nicht wie dein teil verkabel ist. dia datenpins d0-d7 sollten alle gleich sein. worauf es ankommt sind wie oben das RS und das EN signal.
du musst leider in den saueren apfel beißen und dich mal in bezug auf das display und den paraport kundig machen. das datenbaltt zu dem display findes du außerdem bei conrad,de

jonasge
12.08.02, 07:55
Hi !
Ich habe auch so ne Display an mein parport. Es zeigt mir immer an welche Rufnummer gerade anruft
bzw der Name wird angezeigt, wenn er mir bekannt ist. (der datenbank)
Doch seit einiger Zeit spinnt das Display voll rum.
Wenn ich insmod lcd.o mache, kommt ein großer blinkender Courser. Normalerweise sollte es ja der kleine sein.
Wenn ich dann ein echo "Hallo" > /dev/lcd mache kommt das raus:
-------------------------
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Iämmo |
|_______ _______ _______ _ _ _ _ _ |
-------------------------
Wobei die Ä-Strichen noch blinken!!!
Wenn ich dann ein rmmod lcd mache, und das versuche neu zu laden, kommt der gleiche Fehler wieder.
Machmal geht der Fehler weg, wie vor einer Woche und zuzeit geht er gar nicht mehr weg. :-((

Was kann das sein ???

Gruss
Jonas

geronet
12.08.02, 17:18
Prüf mal die Kontakte bzw. Stecker, ob die wirklich stimmen.

jonasge
12.08.02, 17:32
Danke fuer den Tipp! :-)

Eine lötstelle war lose.
Jetzt geht das ganze wieder.


Gruss
Jonas

geronet
12.08.02, 18:03
Ich hätt dir ja noch sagen können welche Lötstelle abgebrochen war. *G*

Grüsse, Stefan