[Lcdproc] 4bit-HD44780 and keymatrix...
Markus Dolze
bsdfan at nurfuerspam.de
Wed Dec 23 21:11:19 UTC 2009
Hi,
-------- Original-Nachricht --------
> Datum: Wed, 23 Dec 2009 20:29:40 +0100
> Von: "Thorsten Godau" <dl9sec at gmx.net>
> An: lcdproc at lists.omnipotent.net
> Betreff: [Lcdproc] 4bit-HD44780 and keymatrix...
> Hi all,
>
> as described in a thread above, i am using a EA DIP204-4 (HD44780->KS0073)
> connected the "4bit"-way to the parallel port.
> As i undestood the documentation, the other signals, that are not used
> for display control can be used for a keymatrix and defined and enabled
> as per an entry "keymatrix_X_Y" in the configuration file.
You can use all lines, except those used as Enable-signal and backlight switch. In case of the 4bit-wiring, you *can* use D0-D4 on the parallel port, even if the are connected to the display.
>
> My keymatrix is the following:
>
> +5V ----------+---------+--------+---------+
> | | | |
> 22k 22k 22k 22k
> | | | |
> Y7 -|<|--+---------+--------+---------+ |
> | | | | | | | |
> o | o | o | o |
> S1 \ | S2 \ | S3 \ | S4 \ |
> o | o | o | o |
> | | | | | | | |
> +---+ +---+ +---+ +---+
> | | | |
> | | | |
> Y8 -|<|--+------------------+---------+ |
> | | | | | | |
> o | | o | o |
> S5 \ | | S6 \ | S7 \ |
> o | | o | o |
> | | | | | | |
> +---+ | +---+ +---+
> | | | |
> X1 ----------+ | | |
> | | |
> X2 --------------------+ | |
> | |
> X3 -----------------------------+ |
> |
> X4 ---------------------------------------+
>
> After being not very successful getting my LCD to work with LCDd,
> i tested the function of the keys in debug mode.
>
> Unfortunately S1/S5, S3/S6 and S4/S7 are delivering the same keycode
> (letter) if being pressed.
> So for me it seems, that the Y-lines are not really toggling from high
> to low and vice versa round robin to get the scanning-effect.
> They seem both to be statically low.
>
> Can anyone confirm that behaviour?
No, I explicitly tried this with my 3x4 matrix keypad and it did work.
Note that when using the 'keymatrix_x_y' with the wiring above you have to use it like this:
keymatrix_2_8=S1
keymatrix_3_8=S2
...
The 'keymatrix' setting counts from '1' whereas the Y# and X# lines are counted from '0' in the documentation.
The keypad is not scanned in a round robin fashion, but like this:
1. Check with all Y = '1' to detect direct keys.
2. Check with all Y = '0' to detect if any key has been pressed.
3. Do a binary seach on Y to find the key actually pressed.
4. Do a final read (not strictly necessary in some cases, but it doesn't hurt).
I added some more comments recently to document what I read: http://lcdproc.cvs.sourceforge.net/viewvc/lcdproc/lcdproc/server/drivers/hd44780.c?r1=1.94&r2=1.95
Regards,
Markus
More information about the LCDproc
mailing list