Keypad with ADC & recognize only once for key presses

Thread Starter

aamirali

Joined Feb 2, 2012
412
Hi,

I have connected 8 keys to single pins of adc. Now adc is continuously scanned & checked if any voltage level changes.

Normally its high means no key. & voltage changes as key is pressed.

Now I want that key is detected only once even if key is presses for long times. What happens when key is presses long time, multiple key is detected which I don't want.

Any suggestions on that.

I took code example from cypress - AN2034. & using MSP430G2553.
 

SPQR

Joined Nov 4, 2011
379
Hi,

Here is a chip from Fairchild that has debounce, and rollover.
HERE's a "one-shot" chip, and you could adjust your polling of the keyboard to some fixed interval.
Another way might be to use only one "one-shot" circuit, and use it as a clock - Adjust the length of the one-shot pulse to equal your polling interval, and if One-shot = HIGH, then input the key push.

The other way is in your software.
Instead of just polling the keys at microsecond intervals you could use an interrupt for each key.

When a key is pressed, what is the program/circuit doing?

I'll bet the experts have better ideas. Let's wait for them.
 
Last edited:

ErnieM

Joined Apr 24, 2011
8,377
I typically put 5 user input buttons on my projects, along with an alphanumeric LCD display. Here's how I process the button presses:

I start by setting up a loop that waits until any button is pressed, then it proceeded to the code to process that button.

Once that process is complete, it enters another loop that waits until all keys are released. That's all my apps needs to handle the input buttons.
 
Top