Page 1 of 1

Matrix keypad problrm

Posted: Thu Dec 01, 2011 7:29 am
by tompzone
hi, i have been trying to use a matrix keypad, i have used the examples provided here, and when i simulate it with flowcode an proteus it works, but on a breadboard, it always sends me several keys (i remember that it always send 4 7 and 1), as if i where pressing them, i tried changing the port adding delays and placing pullup resitors but it still does the same, do i need a special kind of keypad or arrangement (it's a membrane keypad the ones that are so popular on ebay

Re: Matrix keypad problrm

Posted: Thu Dec 01, 2011 8:50 am
by medelec35
tompzone wrote:do i need a special kind of keypad or arrangement (it's a membrane keypad the ones that are so popular on ebay
Yes you do. since the keypad is an open circuit switch. The rows are connected to inputs and the columns are connected to outputs. If you do not use pull-down resistors, on the rows, then rows connected to the microcontroller will be floating, so could randomly go from logic 0 to logic 1 due to the very high input resistance or i/p pins. This would show up as numbers displayed without any key pressed.

The other cause could be that the rows that are suppose to connect to an i/p, maybe connected to a pin that's an o/p only.
Likewise the columns are suppose to connect outputs maybe connected to a pin that's an o/p only.
How the keypad routine works:
Each column in turn is pull low.
Basically if all the rows that are connected to i/p's stay low, then no key is detected.
If a key is pressed then the corresponding row will be pulled high by the port output that has gone from low to high.
At least I think that's how it works not got time to test.

My advice would be:

Check keypad is wired the same as diagram on the last page of Eblock 014 datasheet:
http://www.matrixmultimedia.com/datashe ... 4-30-1.pdf

Check pins of microcontroller connected to rows can be i/p's
Check pins of microcontroller connected to columns can be o/p's

Martin

Re: Matrix keypad problrm

Posted: Thu Dec 01, 2011 10:13 pm
by tompzone
thanks alot that was the problem, now it's fixed thanks alot