keypad scanner

Hi all,

I am implementing a 6x6 matrix keypad scanner in CPLD. My requirment is i should detect multiple key presses also. What i am planning to do is , i will scan the rows (6 of them sequentially) , when all the 6 rows are scanned i will send the 36 bit output(each bit corresponds to each individual key .'0' indicates pressed)to the controller.The scan rate for each row is approximately

32 msec , so every 32x6=192 msec i will be sending the 36 bit code to controller(HCS12).

I want your comments on this implementation in CPLD.

Regards, Praveen

Reply to
praveen.kantharajapura
Loading thread data ...

Praveen,

It depends on what you want to do in case of multiple key press event. In case of single bit key press, send some encoded information (max. 6 bits) instead of transmitting all the 36 bits. The encoded bit transmission is quite good if you don't want to take any action in case of multiple key press event, or if you want to display some extended character in case of multibit key press.

hope that helps. Sunil

Reply to
SK

I do not know why you are so slow, you could easily be a thousand times faster. Since you can only detect a single closure, you could encode the scan into a 6-bit word.

I am glad you realized that you cannot detect multiple simultaneous key closures, without inserting iolation non-linearities (diodes) into the array. Peter Alfke

Reply to
Peter Alfke

I do not know why you are so slow, you could easily be a thousand times faster. Since you can only detect a single closure, you could encode the scan into a 6-bit word.

I am glad you realized that you cannot detect multiple simultaneous key closures, without inserting iolation non-linearities (diodes) into the array. Peter Alfke

Reply to
Peter Alfke

"Peter Alfke" schrieb im Newsbeitrag news: snipped-for-privacy@o13g2000cwo.googlegroups.com...

Why hurry withou a need? By scanning so low you

a) consere power b) do a debounce

??? Been there, done that?

I worked on this topic not too long ago, you CAN easyly detect multiple pressed keys withOUT having diodes in the matrix. All you need is a "walking one" scan.

Regards Falk

Reply to
Falk Brunner

"Peter Alfke" schrieb im Newsbeitrag news: snipped-for-privacy@o13g2000cwo.googlegroups.com...

BTW. I dont know if this is a problem in my newsserver or your newsagent. I see all yor posts twice (no Iam not drunk, unfortunately ;-)

Regards Falk

Reply to
Falk Brunner

^^^^ - I had R5C3 here which didn't follow - - -

then.

Reply to
John_H

That's fine for two key rollover, but not for more than 2 keys.

--
--Ray Andraka, P.E.
President, the Andraka Consulting Group, Inc.
 Click to see the full signature
Reply to
Ray Andraka

And nobody saw my response explaining the fallacy of multiple-key encoding: Imagine a 2 by 2 matrix with all four switches closed. Then open one of them: No detectable difference. Ray already wrote: 2-key rollover is ok, multiple switches not. Peter Alfke, from home

Reply to
Peter Alfke

Unless Praveen has each of the 36 keys wired to a separate CPLD pins with common ground or pull-ups, it would make more sense to group the keys.

I suggest grouping keys that will not be depressed together. If the keypad where hexidecimal with 18 additional control keys: you could group/encode the hexidecimal into a single nibble (4bits) and add

3x6bits (18bits) for the treatment of simultaneous control key depression.

------------------ Personally I would output an encoded 8bit byte for each row, at a maximum of 5 simultaneous keys per row.

bits 0-4 (5bits) would hold 5 simultaneous key states, bits 5-7 (3bits) would denote which of the 8 rows (Row:0,1,2,3,4,5,6,7) the first bits 0-4 represented.

Yes treatment is 40keys. Yes a full scan is 64bits wide. However the data is transfered in very common and manageable 8bit groups. Hey, I did say personally!

Nme. God Bless.

Reply to
dave

I need to sense multiple key presses , how will you do this with a

6-bit word.
Reply to
praveen.kantharajapura

I agree with you i can be still faster.

In my key board i have a "shift" key which works in conjuction with keys"1" , "2" and "3". for ex: when shift -> "1" is pressed do some operation, how will you detect this with a 6-bit approach, whereas this can be easily done in a

36-bit approach.

waiting for u r reply

Reply to
praveen.kantharajapura

falk, as you know i am implementing this in a CPLD. In my application i need multiple(two) key press detection. As many of them are opposing my 36-bit approach for detecting two keys pressed simultaneously, my question is how will u achieve multiple key detection with a 6-bit approach.

Reply to
praveen.kantharajapura

schrieb im Newsbeitrag news: snipped-for-privacy@o13g2000cwo.googlegroups.com...

First of all, as some people noted, without having diodes in the matrix there are possibilities where you can't detect any pressed (or non-pressed) key to 100%. I thougt is was possible, until I had a look back on a few datasheets and used so scratch paper to get it clear. Ashes onto my head ;-) Second, the 6-bit approach wasn't my idea, though it is feasable. If you have only some of the keys to be pressed simultaneously (like you said some kind of SHIFT key), simply reserve one or two bits inside your code word to exlusively encode the state of this key. the rest uses simple binary encoding inside the 6 bit word. So make it easy and use a "standard" 8 bit code and use bit 7 and 6 to encode two s"shift keys" the rest use for the normal keys, which are usually not pressed simultaneously. Depending on the size of your CPLD, you could use a standard UART(inside your CPLD) to transmit your code to the microcontroller.

Regards Falk

Reply to
Falk Brunner

Probably lost in another thread:

Why not output an encoded 8bit byte for each row, at a maximum of 5 simultaneous keys per row.

bits 0-4 (5bits) would hold 5 simultaneous key states, bits 5-7 (3bits) would denote which of the 8 rows (Row:0,1,2,3,4,5,6,7) the first bits 0-4 represented.

Yes treatment is 40keys. Yes a full scan is 64bits wide. However the data is transfered in very common and manageable 8bit groups.

Hey, IMHO!

Nme. God Bless.

Reply to
dave

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.