[Lcdproc] 4bit-HD44780 and keymatrix...

Thorsten Godau dl9sec at gmx.net
Fri Dec 25 17:55:58 UTC 2009


Hi again,

first of all, i still could NOT get the display working with LCDproc,
so i concentrated my efforts to get the keypad running correctly
(my next approach for the display is to use the i2c-tiny-usb adapter
and the i2c-connection type with the PCF8574 as described in the
documentation...)

> > > My keymatrix is the following:

I substituted the Sx with the real names to make it easier to read.

> > > 
> > >   +5V ----------+---------+--------+---------+
> > >                 |         |        |         |
> > >                22k       22k      22k       22k
> > >                 |         |        |         |
> > >    Y7 -|<|--+---------+--------+---------+   |
> > >             |   |     |   |    |   |     |   |
> > >             o   |     o   |    o   |     o   |
> > >          User\  |  Menu\  | Down\  | Right\  |
> > >             o   |     o   |    o   |     o   |
> > >             |   |     |   |    |   |     |   |
> > >             +---+     +---+    +---+     +---+
> > >                 |         |        |         |
> > >                 |         |        |         |
> > >    Y8 -|<|--+------------------+---------+   |
> > >             |   |         |    |   |     |   |
> > >             o   |         |    o   |     o   |
> > >            Up\  |         |Enter\  |  Left\  |
> > >             o   |         |    o   |     o   |
> > >             |   |         |    |   |     |   |
> > >             +---+         |    +---+     +---+
> > >                 |         |        |         |
> > >    X1 ----------+         |        |         |
> > >                           |        |         |
> > >    X2 --------------------+        |         |
> > >                                    |         |
> > >    X3 -----------------------------+         |
> > >                                              |
> > >    X4 ---------------------------------------+ 
> > > 

> Your description in the drawing uses the names for Y#/X# like in the HTML
> documentation. Counting starts from '1' there as well. I was looking at > the code comments, where Y#/X# are counted from '0'. I should change this
> eventually.

Yes, i used the docs as the base for the numbering starting with 1.

These are the definitions of my keys:

KeyMatrix_2_7=Menu
KeyMatrix_3_8=Enter
KeyMatrix_1_8=Up
KeyMatrix_3_7=Down
KeyMatrix_4_8=Left
KeyMatrix_4_7=Right
KeyMatrix_1_7=User

That's what the log says:

Dec 25 18:20:35 LinuxPLC LCDd: LCDd version 0.5.2 starting
Dec 25 18:20:35 LinuxPLC LCDd: Built on Jan 13 2009, protocol version 0.3, API version 0.5
Dec 25 18:20:35 LinuxPLC LCDd: Using Configuration File: /etc/LCDd.conf
Dec 25 18:20:35 LinuxPLC LCDd: Set report level to 5, output to syslog
Dec 25 18:20:35 LinuxPLC LCDd: Server running in foreground
Dec 25 18:20:35 LinuxPLC LCDd: Listening for queries on 127.0.0.1:13666
Dec 25 18:20:35 LinuxPLC LCDd: HD44780: Matrix key 0 6: "User"
Dec 25 18:20:35 LinuxPLC LCDd: HD44780: Matrix key 0 7: "Up"
Dec 25 18:20:35 LinuxPLC LCDd: HD44780: Matrix key 1 6: "Menu"
Dec 25 18:20:35 LinuxPLC LCDd: HD44780: Matrix key 2 6: "Down"
Dec 25 18:20:35 LinuxPLC LCDd: HD44780: Matrix key 2 7: "Enter"
Dec 25 18:20:35 LinuxPLC LCDd: HD44780: Matrix key 3 6: "Right"
Dec 25 18:20:35 LinuxPLC LCDd: HD44780: Matrix key 3 7: "Left"
Dec 25 18:20:35 LinuxPLC LCDd: hd44780: Using ea_ks0073 charmap
Dec 25 18:20:39 LinuxPLC LCDd: Key "Menu" is now reserved in exclusive mode by client [-1]
Dec 25 18:20:39 LinuxPLC LCDd: Key "Enter" is now reserved in shared mode by client [-1]
Dec 25 18:20:39 LinuxPLC LCDd: Key "Up" is now reserved in shared mode by client [-1]
Dec 25 18:20:39 LinuxPLC LCDd: Key "Down" is now reserved in shared mode by client [-1]
Dec 25 18:20:39 LinuxPLC LCDd: Key "Left" is now reserved in shared mode by client [-1]
Dec 25 18:20:39 LinuxPLC LCDd: Key "Right" is now reserved in shared mode by client [-1]
Dec 25 18:20:39 LinuxPLC LCDd: screenlist_switch: switched to screen [_server_screen]

That's the output after pressing "Left":
Dec 25 18:22:54 LinuxPLC LCDd: HD44780_get_key: Key pressed: D (4,0)
Dec 25 18:22:54 LinuxPLC LCDd: Driver [hd44780] generated keystroke D

That's the output after pressing "Right":
Dec 25 18:23:08 LinuxPLC LCDd: HD44780_get_key: Key pressed: D (4,0)
Dec 25 18:23:08 LinuxPLC LCDd: Driver [hd44780] generated keystroke D

That's the output after pressing "Down":
Dec 25 18:23:14 LinuxPLC LCDd: HD44780_get_key: Key pressed: C (3,0)
Dec 25 18:23:14 LinuxPLC LCDd: Driver [hd44780] generated keystroke C

That's the output after pressing "Enter":
Dec 25 18:23:16 LinuxPLC LCDd: HD44780_get_key: Key pressed: C (3,0)
Dec 25 18:23:16 LinuxPLC LCDd: Driver [hd44780] generated keystroke C

That's the output after pressing "Menu":
Dec 25 18:23:40 LinuxPLC LCDd: HD44780_get_key: Key pressed: B (2,0)
Dec 25 18:23:40 LinuxPLC LCDd: Driver [hd44780] generated keystroke B

That's the output after pressing "Up":
Dec 25 18:23:12 LinuxPLC LCDd: HD44780_get_key: Key pressed: A (1,0)
Dec 25 18:23:12 LinuxPLC LCDd: Driver [hd44780] generated keystroke A

That's the output after pressing "User":
Dec 25 18:23:45 LinuxPLC LCDd: HD44780_get_key: Key pressed: A (1,0)
Dec 25 18:23:45 LinuxPLC LCDd: Driver [hd44780] generated keystroke A

As you can see, the keys that are connected to the same X-line are
delivering the same keystroke. IMHO the Y-lines are not switched 
correctly. I checked the Y-lines with the scope and they are both
statically low. There are no high-pulses.

> Can you try what happens if you connect Y7 to 'D0' and Y8 to 'D1' on the
> parallel port?

I can try it, yes. What is your intention with that test?

Regards, Thorsten


More information about the LCDproc mailing list