keypad controller

Hi all,

I want to implement a 6x6 matrix keypad controller in hardware which should be able to detect multiple key presses. Can anybody suggets how to go about this.

Regards, Praveen

Reply to
praveen.kantharajapura
Loading thread data ...

Hi all,

I want to implement a 6x6 matrix keypad controller in hardware which should be able to detect multiple key presses. Can anybody suggest how to go about this??

Regards, Praveen

Reply to
praveen.kantharajapura

By "multiple" do you mean simultaneous key presses, or just a memory of sequence of several key presses?

This message was sent using the comp.arch.embedded web interface o

formatting link

Reply to
antedeluvian

Sounds like a standard matrix to me. This is a link to a diode rom circuit. The only difference is that you don't burn out the diodes but put a keypad switch in series with them.

formatting link

Peter

Reply to
Peter

Hi you,

if you mean more than one key pressed same time, you could use this. (Please expand to 6x6 matrix). Set the Y-lines to high, only one at same time, and read the X-lines to get the pressed key(s) in this row.

Y0 o Y1 o Y2 o Y3 o | T | T | T | T | --- | --- | --- | --- o--o o-->|--. o--o o-->|--. o--o o-->|--. o--o o-->|--. | | | | | | | | X0 o---)-----------o-)-----------o-)-----------o-)-----------o- | T | T | T | T | --- | --- | --- | --- o--o o-->|--. o--o o-->|--. o--o o-->|--. o--o o-->|--. | | | | | | | | X1 o---)-----------o-)-----------o-)-----------o-)-----------o- | T | T | T | T | --- | --- | --- | --- o--o o-->|--. o--o o-->|--. o--o o-->|--. o--o o-->|--. | | | | | | | | X2 o---)-----------o-)-----------o-)-----------o-)-----------o- | T | T | T | T | --- | --- | --- | --- o--o o-->|--. o--o o-->|--. o--o o-->|--. o--o o-->|--. | | | | | | | | X3 o---)-----------o-)-----------o-)-----------o-)-----------o- | | | | | | | | (created by AACircuit v1.28.6 beta 04/19/05

formatting link

HTH Michael

Reply to
Michael Lange

Perhaps obvious, but you do need some pull-down resistors on the X lines. Less obviously, there is an RC time constant between the stray capacitance and the resistors you choose (when the line is going low), so you might want to have the processor twiddle its thumbs for enough time to let the voltage settle. Maybe a microsecond or so with 10K (assuming short connections), proportionally longer with higher resistances.

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
 Click to see the full signature
Reply to
Spehro Pefhany

A few years ago there was a discussion of key matrices that dispensed with diodes and that could detect various things, such as multiple keys down, rollover, etc. I have lost what I saved, but I recall that the cost was the full intersection range of the key positions. I.e. a 4x4 matrix could handle, say, 10 keys in place of 16. I think the discussion was right here on c.a.e.

--
"If you want to post a followup via groups.google.com, don't use
 the broken "Reply" link at the bottom of the article.  Click on 
 Click to see the full signature
Reply to
CBFalconer

Hi,

that's totally correct. Thanks.

Michael

Reply to
Michael Lange

Have a look at:

formatting link

5 lines can hanlde a 4 x 4 matrix 6 lines can handle a 5 x 5 matrix 7 lines can handle a 6 x 6 matrix etc.

I made a full 4 row querty keyboard using this scheme and it does work.

Alan

--
++++++++++++++++++++++++++++++++++++++++++
Jenal Communications
 Click to see the full signature
Reply to
Alan

Reply to
praveen.kantharajapura

By scanning all the lines and using shifting registers. How are you going to debounce the signals? That would be much simpler to use a 6I6O microcontroler.

Reply to
Lanarcam

... snip ...

That's the sort of thing. There was a better discussion and/or refs than that app-note, IIRC. It also developed the generic rules and penalties for configurations.

--
 Some informative links:
   news:news.announce.newusers
 Click to see the full signature
Reply to
CBFalconer

Do what the PS/2 keyboard does. Use keycodes to indicate key transistions, eg. 0xFF01 for keypress and 0xF001 for key release. Buffer these codes in the FPGA using a FIFO. Let the firmware figure out how to use these codes for its purposes.

Some FPGA ideas... - use two flip-flops in series and an XOR to capture the transistion - Generate logic to create the keypress and keyrelease codes, then place the code into the FIFO. Generate unique codes for each key (0x00 -

0x0F for the keypad below) and place these into the FIFO after the transistion code. - Use an arbiter to prevent key collisions. - Use a slow scanrate (10ms per row?) to prevent keybounce problems.

Hope this helps,

- Richard

Reply to
Richard Willis

In that example, it appears:

I/O Usable Required Required Pins Switches Diodes Resistors

3 4 4 4 4 9 6 6 5 16 8 8 6 25 10 10

Half the diodes are used as a wire-OR configuration.

It will work okay with n-keys, _up to a point_. The keys along the diagonal can only be detected if they are the only key pressed, because their feedback is returned to the current scan line, where it cannot be detected (read back.) The way they are detected, despite this problem, is only because of the wire-OR providing feedback, too. But that only provides a unique indication if no other keys are being pressed at the time.

So, if you eliminate the diagonal keys (reducing from 16 to 12, or from 25 to 20, etc.), then n-keys can be detected.

Jon

Reply to
Jonathan Kirwan

I actually have a product which uses 20 keys in a 5 x 5 matrix with the diagonal keys eliminated. It makes it easier to detect (or rather ignore) the diagonal keys.

Also I don't require roll-over for this unit. In fact two keys pressed together usually means an error condition - so ignore/alarm (except on power up when holding two specific keys down together puts the unit into programming mode).

Alan

--
++++++++++++++++++++++++++++++++++++++++++
Jenal Communications
 Click to see the full signature
Reply to
Alan

Indeed. I just thought it might not be entirely clear from the PDF file you pointed at and was worth bringing to the surface in the clear light of day. Particularly since the OP was talking about "multiple key presses."

Well, the OP was talking about that feature in particular. So it doesn't hurt to point out the boundaries/limitations of the indicated solution. (And the PDF did a poor job of explaining the reasoning behind the design, in my opinion, so this aspect wasn't particularly clear to an inexperienced eye.)

But since you've brought up your case, one can design such features as you probably needed using only four I/O lines instead of 5 for all 20 keys. Including detecting special key pairs. Speaking minimally.

Jon

Reply to
Jonathan Kirwan

Agreed - that's why I specifically noted that I ignore the diagonals, but well worth highlghting for the OP.

Agreed again. There are many different ways to skin a cat (as they say). This one worked for me in this instance. Other times I have just used enough I/O pins as required for one per row and one per column (usually 3 x 4 keypads). I NEVER scan them continuously though, like some people seem to do automatically, I always wait for a keypress then scan.

Alan

--
++++++++++++++++++++++++++++++++++++++++++
Jenal Communications
 Click to see the full signature
Reply to
Alan

I must have missed the fact that you pointed it out in your first post on the matter.

Jon

Reply to
Jonathan Kirwan

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.