FPGARelated.com
Forums

keypad scanner

Started by Unknown June 3, 2005

SK wrote:
> 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.
I need to sense multiple key presses , how will you do this with a 6-bit word.
> > hope that helps. > Sunil > > > <praveen.kantharajapura@gmail.com> wrote in message > news:1117770846.122441.301610@g47g2000cwa.googlegroups.com... > > 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 > >

Peter Alfke wrote:
> I do not know why you are so slow, you could easily be a thousand times > faster.
I agree with you i can be still faster.
> Since you can only detect a single closure, you could encode the scan > into a 6-bit word. >
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
> I am glad you realized that you cannot detect multiple simultaneous key > closures, without inserting iolation non-linearities (diodes) into the > array. > Peter Alfke

Falk Brunner wrote:
> "Peter Alfke" <alfke@sbcglobal.net> schrieb im Newsbeitrag > news:1117771436.575914.41260@o13g2000cwo.googlegroups.com... > > > I do not know why you are so slow, you could easily be a thousand times > > faster. > > Why hurry withou a need? By scanning so low you > > a) consere power > b) do a debounce > > > 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. > > ??? 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.
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.
> > Regards > Falk
<praveen.kantharajapura@gmail.com> schrieb im Newsbeitrag
news:1118032365.362384.278370@o13g2000cwo.googlegroups.com...

> > 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. > > 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.
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
praveen.kantharajapura@gmail.com wrote:
> > Falk Brunner wrote: > >>"Peter Alfke" <alfke@sbcglobal.net> schrieb im Newsbeitrag >>news:1117771436.575914.41260@o13g2000cwo.googlegroups.com... >> >> >>>I do not know why you are so slow, you could easily be a thousand times >>>faster. >> >>Why hurry withou a need? By scanning so low you >> >>a) consere power >>b) do a debounce >> >> >>>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. >> >>??? 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. > > > 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. > >>Regards >>Falk > >
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.