Keypad causing problems?

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Post Reply
VJR85
Posts: 10
Joined: Wed Sep 06, 2006 8:09 pm
Contact:

Keypad causing problems?

Post by VJR85 » Tue Nov 14, 2006 9:22 pm

I have a keypad to input data (1-9) into a 74147 encoder. This runs through a 74121 one-shot with each keypunch advancing the state of a JK flip-flop counter. The counter goes through three states with each corresponding to a digit of a three-digit number. The data from the original encoder goes to 7474 D flip-flops for storage and this data is sent to one of the decoder/7-segment displays when that flip-flop receives the clock signal. The next counter state sends the input digit to the next decoder/7-seg, etc.

The problem is the output from the one-shot will pulse twice intermittently with one push of the keypad button. It will also cause the counter to enter an incorrect state with all outputs being high or low for some reason.

If I bypass the keypad and simply tap the active-low inputs of the encoder to ground, it works fine. Is there something wrong with the keypad?

I have the single input wire from the keypad hooked to ground. When I push a button on it, the output from that digit seems to be connected to ground. I have the wires from each digit going to the encoder. What is causing this? Is this not the right way to wire it? It seems like its just a simple switch with each button, but it's causing a different reaction.

Thanks.

rshayes
Posts: 1286
Joined: Tue Mar 04, 2003 1:01 am
Contact:

Post by rshayes » Wed Nov 15, 2006 3:38 am

The "simple switch" is a myth. Very few switches make or break contact without bouncing. Usually this occurs in a millisecond time frame. Most logic circuits can respond to pulses that are a microsecond or less wide, so a bouncing switch looks like multiple trigger pulses.

The monostable should ignore extra pulseds that occur during the timing interval. Any short pulse after the timing interval will generate a second pulse.

The keypad will probably be a switch closure to ground. To generate a high logic level you will need a pull up resistor on each switch. This is usually in the 1K to 10K range. TTL logic logic inputs pull themselves high if left open circuited, but this will result in very unreliable operation.

One possible fix would be to add an RC network before the trigger input of the monostable multivibrator. Since the input is a schmidt trigger, the signal would have to reverse direction for long enough to force the voltage across to the other threshold. Short spikes could be filtered out this was.

Try looking at the keypad output signals with an oscilloscope. This will give you an idea of what has to be done to make them usable for controlling logic.

User avatar
Sambuchi
Posts: 366
Joined: Tue Jan 18, 2005 1:01 am
Location: Orlando FL
Contact:

Post by Sambuchi » Wed Nov 15, 2006 5:03 am

you could try pulling all of your logic IC's into a small Micro.

Its very easy to write Switch Debounce code.

User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Post by philba » Wed Nov 15, 2006 8:31 am

take a look at this document. towards the end there are several suggestions on debounce circuits. http://www.ganssle.com/debouncing.pdf

Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests