0

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
    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. – Ignacio Vazquez-Abrams Jan 02 '14 at 03:36
  • @IgnacioVazquez-Abrams (+1) That seems to be an interface chip (http://www.ebay.com/itm/1pcs-MM74C922N-MM74C922-16-Key-Encoder-FAIRCHILD-/170728404588) 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. – Mawg says reinstate Monica Jan 02 '14 at 03:43
  • 1
    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). – Ignacio Vazquez-Abrams Jan 02 '14 at 03:45
  • 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? http://extremeelectronics.co.in/avr-tutorials/4x3-matrix-keypad-interface-avr-tutorial/ – Mawg says reinstate Monica Jan 02 '14 at 05:12
  • 1
    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). – Ignacio Vazquez-Abrams Jan 02 '14 at 05:43
  • Well, I am required to poll other devices on the bus every 5ms, so I guess I could poll that too. But, honestly, I don't care (and have a slight preference for ISR). Maybe you should post an answer? I just want something that I can use with minimal effort & cost as keypad is only a very small part of the system. – Mawg says reinstate Monica Jan 02 '14 at 05:48

1 Answers1

1

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.

Ignacio Vazquez-Abrams
  • 48,282
  • 4
  • 73
  • 102
  • 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? – Mawg says reinstate Monica Jan 03 '14 at 02:14
  • 1
    @Mawg: Correct. You can't get around polling a matrix keypad *somehow*. – Ignacio Vazquez-Abrams Jan 03 '14 at 02:18
  • +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. – Mawg says reinstate Monica Jan 03 '14 at 02:20