3X4 KEY PAD INTERFACE

Hello,

I am looking for a 3x4 keypad interface with only 6 i/o lines of a uc. I would like to use interrupt on chage as well to wake from sleep.

Give me suggestions/inputs.

Thanks for your time

-dK

Reply to
dk
Loading thread data ...

Imprecavo contro il nuovissimo ordinamento quando dk ha detto :

can't you just use a normal keyboard and a software serial? it has just 2 lines for data and 2 for +5 and GND.

formatting link

--
Nuno on zx-6r '04 & CRe 250 '99 working in progress...
Say you, say me...say 'na mignotta!
*** www.gladio.org ***
Reply to
N1

Are you looking for a preassembled module or to make something from scratch? Do you need to handle multiple keypresses simultaneously?

If not then the simplest method that comes to mind is to run each switch into a 16 to 4 encoder. That can be fairly simple - have four data lines to the MCU, each weakly tied to ground with separate resistors. Assign each switch a number 1-12 (_not_ 0-11).

Assuming simple SPST switches wire one pin of each button to a logically high voltage (Vcc) and the other through diodes to the 'ones' in the binary expression of that number on the data lines. I haven't drawn this out to confirm it but I suspect you need a separate diode for each 'one' from each button to prevent the wiring for each button interfering with the others - but that is 22 diodes in total for 12 buttons which is hardly unmanagable.

A picture would say a thousand words here, I'm sure, but I'm not at my own machine right now and there isn't nothing more powerful than Windows Paint here. Let me know if you can't figure out what I mean from the description above.

--
Andrew Smallshaw
andrews@sdf.lonestar.org
Reply to
Andrew Smallshaw

Google for 74C922. It uses 4 data lines and a data available line which can be used as an interrupt.

--
John B
Reply to
John B

You could use an inexpensive shift register such as the HC595 on 3 lines, and then read the inputs on the remaining three. If you make sure upon sleep that all lines are low on the SR then any keypress will make an input line (with pullup) go low for wakeup. During normal operation, of course, only one line would be low at a time during the scan of the matrix.

That configuration would allow up to 3x8 keys with 6 lines.

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

PCA9554A is one solution - two wires, up to 16 keys. HEF4021 is another, but needs pullups. A small SPLD can also do this, with 2 wires. Or a small 14 pin uC...

-jg

Reply to
Jim Granville

Connect 1 of the 4 lines to 0v

Connect the other 3 to uC pins to tristatable outputs (possibly put pullups on these pins

Connect the 3 of 3 lines to inputs that have pullup resistors.

Read the inputs with all outputs hi-z - chk for 0v column Make a column 0v, read inputs Make next one low, read inputs Make next one low, read inputs Job done. It doesn't support multiple simultaneous keypresses, but hey! you can't have everything.

Reply to
Rocky

Hello Everyone here,

First things first, thank you all for the quick responses.

To answer Andrew Smallshaw, i am trying to do it in a pre-assembled module and there are no multipe keypresses.

I am just looking at the way Rocky has done it. I would come back to Rocky and take more of his time.

Regards,

-dK

Reply to
dk

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.