Matrix Keyboard IC with pure logic? - Page 1
Forum section: electronics / beginners

author: bitman
author_rank: Unknown
timestamp: April 12, 2017, 01:29:36 am
content: It's fairly straight forward to connect a matrix type keypad to a controller. Lots of demos and examples goes through this. But I'm trying to come up with a way to simplify the interface to the controller using a serial interface. Ie. send a key-id value serially instead of having to use 8 or more pins just for the keypad, not to speak of displays and everything else you have to connect.I've found a few specific keypad ICs that seems very specialized for mobile devices or other exact purposes. Is there a general IC for this? I'm trying to come up with a way just using logic gates that would give me a bit for each button. I could then decode that "byte" or however long it would be and send it serially? Anyway, perpeptual newbie with little to no clue, but since I haven't figured out a good search to show if this really exist, I thought of dropping a note here.

author: Ian.M
author_rank: Super Contributor
timestamp: April 12, 2017, 02:09:02 am
content: One ADC pin good enough?http://www.microchip.com/forums/m694613.aspx

author: Mr.B
author_rank: Unknown
timestamp: April 12, 2017, 02:30:22 am
content: Very smart Ian.I like it.

author: bitman
author_rank: Unknown
timestamp: April 12, 2017, 02:55:37 am
content: Quote from: Ian.M on April 12, 2017, 02:09:02 amWow - I hadn't even thought of doing it that way. Thanks for the inspiration! Maybe logic gates wasn't the right method

author: Ian.M
author_rank: Super Contributor
timestamp: April 12, 2017, 03:10:14 am
content: You can easily improve it by replacing R7 with a 0.7mA current source (assuming a 5V supply)which 'unsquishes' the voltage steps at the top end of the range. A dual PNP transistor as a current mirror and a 6K2 resistor to bias it gives you an average of 54 ADC counts between buttons, with a worst case of 47, an improvement factor of 2.6 over the original's discrimination. Use E96 374R resistors in place of the 390R resistors and you can even out the voltage steps almost totally, to 53 or 54 counts per step. Not bad for eight resistors and a single package dual transistor compared to the cost of a keypad controller . . . .

author: Vtile
author_rank: Super Contributor
timestamp: April 12, 2017, 02:35:46 pm
content: http://www.computer-engineering.org/ps2keyboard/

author: Ian.M
author_rank: Super Contributor
timestamp: April 12, 2017, 02:50:42 pm
content: You can also often multiplex the matrix keypad with some other parallel bus. Use either Schottky diodes or buffers + current limiting resistors in each line from the bus to the keypad so that multiple key-presses cant short bus lines together. The classic case is a 4 bit HD44780 LCD interface. While the E strobe is low the data bus , R/nW and RS are 'don't care' and the display doesn't drive any of them, which means you have 6 lines available to drive the matrix. One extra input pin gets you 6 buttons with no more than 6 diodes and a pullup. Add another input pin and pullup for another 6 buttons etc. Or add a 4 line to 1 line data selector or analog switch controlled by two of the output lines and read a 16 key 4x4 keyboard with a single digital input.

author: Zero999
author_rank: Super Contributor
timestamp: April 12, 2017, 05:24:40 pm
content: Does it have to work with more than one key pressed simultaneously?The analogue keypad circuits are good but will only work with one key pressed at a time.