Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

What is key debounce and how to eliminate it?

Status
Not open for further replies.

saudrehman

Member level 1
Joined
Dec 20, 2005
Messages
40
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,697
hi fuys
can any explain what is key debounce and
steps to eliminate it in keys???
 

alzomor

Advanced Member level 2
Joined
Jun 9, 2005
Messages
674
Helped
39
Reputation
78
Reaction score
8
Trophy points
1,298
Location
Germany
Activity points
6,406
Re: Key debounce

Hi

key bouncing can be sean on oscliscope or Logic analyzer .
if you press a key -just once- you will see on the Logic analyzer more than one pulse.
to over come this you had to use a low pass filter , you can just out a capacitor to gound to filter the small pulses wich follows the main pulse.

In SW you can make a time window after the 1st pulse in which stop reading.

Salam
Hossam Alzomor
 

sunish

Advanced Member level 4
Joined
Sep 4, 2005
Messages
117
Helped
10
Reputation
20
Reaction score
2
Trophy points
1,298
Activity points
2,360
Re: Key debounce

hai
from the above answer,i hope that u understod what a key debounce is.it happens due to the mechanical aspects of the key.
what we normaly do to eliminate this(in software) we check the key status first,then will provide a delay of 20 ms (normaliy we keep pressing the key for more than 20 ms), and again read the key status.if we are getting the same value,we will take it as the key is pressed.this way we can eliminate the key debounce.
 

RICKYLO

Junior Member level 3
Joined
Jan 15, 2006
Messages
25
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,528
Re: Key debounce

As explained above, In a digital circuit, You need to have a better or let me say accurate pulse for triggering, clocking etc. the switch being a mechanical device has a tendency of bouncing several times when you push or press it. This can cause noise which is a problem in digital circuits so you have to come up with a method to stop this unwanted "spikes" caused by the switch.
You can use an RS- FLIP FLOP also called(SR-Flip Flop) to eliminate such problem. You can use the '279 "quad SR latch" It gives you four of them into one package.


Hope this answers your question.


Rickylo
 

pop48m

Junior Member level 2
Joined
Oct 13, 2005
Messages
20
Helped
5
Reputation
10
Reaction score
2
Trophy points
1,283
Activity points
1,413
Re: Key debounce

saudrehman said:
hi fuys
can any explain what is key debounce and
steps to eliminate it in keys???

This is the best reference I have seen.

Pop
 

thuvu

Member level 3
Joined
Jan 3, 2006
Messages
65
Helped
9
Reputation
18
Reaction score
3
Trophy points
1,288
Activity points
1,819
Key debounce

One of the simplest techniques that I use is the following:

while(read_key()==NO_KEY_PRESSED)
;
delay_20_ms();
read_key();

As you can see we wait until a key is pressed.Then we wait some msec in order to avoid bouncing and then we read the actual value of key.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top