I was doing a combined project with a friend, with me on s/w and him on h/w. After a year of coding on my part & not much activity on his, he announced that he is "too busy" to continue.

That leaves me, a pure s/w guy with little or no h/w knowledge to continue. I need a 4x3 keypad which will work with an Atmel UC3 series 32-bit microprocessor - can you advise?

Preferably something with sample code.

As I have no o/s, should I go interrupt driven or polled? (told you I am not a h/w guy ;-)

Thanks in advance for any help.

  • 1
    \$\begingroup\$ I have an awesome circuit for this... which unfortunately uses an obsolete component (MM74C922). If you can find/pick a decent replacement, I don't mind helping with the rest. \$\endgroup\$ – Ignacio Vazquez-Abrams Jan 2 '14 at 3:36
  • \$\begingroup\$ @IgnacioVazquez-Abrams (+1) That seems to be an interface chip (ebay.com/itm/1pcs-MM74C922N-MM74C922-16-Key-Encoder-FAIRCHILD-/…) I don't mind to buy, but what about the keypad? Long term, of course, I would prefer something that is not obsolete, but I can live with it n a prototype. Thanks for your quick reply. \$\endgroup\$ – Mawg says reinstate Monica Jan 2 '14 at 3:43
  • 1
    \$\begingroup\$ Any 4x4 matrix keypad should do, even those cheap blue and red membrane keypads. Or 4x3, since that's what you're looking for (now that I read it). \$\endgroup\$ – Ignacio Vazquez-Abrams Jan 2 '14 at 3:45
  • \$\begingroup\$ Oopos, yes, I just realize, I only need 10 digits, plus maybe cancel. $x3 or 4x4, not really important. Do you think that I could just use this device & code? extremeelectronics.co.in/avr-tutorials/… \$\endgroup\$ – Mawg says reinstate Monica Jan 2 '14 at 5:12
  • 1
    \$\begingroup\$ That code/technique will work fine, but require constant polling. The advantages of something like the '922 are 1) interrupt-driven design, and 2) fewer pins (1 interrupt and 4 data [with OE optional, if you want to share the data pins] instead of 4 row and 3 column). \$\endgroup\$ – Ignacio Vazquez-Abrams Jan 2 '14 at 5:43

The circuit I use has the MM74C922 4x4 matrix encoder at its heart. The advantages of using it are that it provides an interrupt for keypress notification plus it handles debouncing the keys.

MM74C922 schematic

DA connects to an interrupt pin so that the MCU can be notified when a key has been pressed. For 4x3 operation, leave Y4 disconnected (since the Yx pins are sensing).

Note however that the MM74C92x is obsolete, and supplies will dry up over time. You should look for a more recent part such as the TCA8418 or MAX7360 which, although not drop-in replacements, do offer additional capabilities which may remove some of the burden from the MCU.

| improve this answer | |
  • \$\begingroup\$ If I understand correctly, I can just connect a keypad directly to my board and poll it regularly, or I can place that chip between them and the chip will poll & trigger an ISR when a key is pressed. Is that correct? \$\endgroup\$ – Mawg says reinstate Monica Jan 3 '14 at 2:14
  • 1
    \$\begingroup\$ @Mawg: Correct. You can't get around polling a matrix keypad somehow. \$\endgroup\$ – Ignacio Vazquez-Abrams Jan 3 '14 at 2:18
  • \$\begingroup\$ +1 Thanks. Ok, I am asking another h/w friend if he can help with the "chip in the middle". Otherwise, I think I will go with the link I posted above which gives polling code for my Atmel processor. Thanks for being so helpful. \$\endgroup\$ – Mawg says reinstate Monica Jan 3 '14 at 2:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.