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
keypad scanner
Started by ●June 3, 2005
Reply by ●June 3, 20052005-06-03
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 <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 >
Reply by ●June 3, 20052005-06-03
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 by ●June 3, 20052005-06-03
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 by ●June 3, 20052005-06-03
"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. Regards Falk
Reply by ●June 3, 20052005-06-03
"Peter Alfke" <alfke@sbcglobal.net> schrieb im Newsbeitrag news:1117771436.575914.41260@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 by ●June 3, 20052005-06-03
"John_H" <johnhandwork@mail.com> wrote in message news:wC1oe.16$Np1.395@news-west.eli.net...> "Falk Brunner" <Falk.Brunner@gmx.de> wrote in message > news:3gbjurFbm5d1U1@individual.net... > > > > ??? 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 > > You can easily detect *2* keypresses without diodes. If you press R1C1, > R5C1, and R1C3, you can't tell if R5C3 is pressed or not. A drive to R5^^^^ - I had R5C3 here which didn't follow - - -> results in C1 and C3 sensed because the two columns are shorted at row 1. > In high school I had fun turning off my TI calculator by pressing 3 keys > that box in the power button, R5C3 in the example. I was a geek eventhen.
Reply by ●June 3, 20052005-06-03
Falk Brunner wrote:>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. > >That's fine for two key rollover, but not for more than 2 keys. -- --Ray Andraka, P.E. President, the Andraka Consulting Group, Inc. 401/884-7930 Fax 401/884-7950 email ray@andraka.com http://www.andraka.com "They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin, 1759
Reply by ●June 4, 20052005-06-04
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 by ●June 5, 20052005-06-05
Peter Alfke wrote:> 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 >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.






