Continue to Site

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.

debounce for switch expalantion

Status
Not open for further replies.

hodahussein

Full Member level 2
Joined
Apr 17, 2007
Messages
144
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
2,276
dear all

i have virtex 2pro30 kit so i configured one switch for reset if i pressed on it
but i did not make any debounce code just simple check on state of switch
is the debounce necessary or not?
aslo about debounce code if i designed it using FSM "showed in image ' can i know how many flip flop is used?

wait your help
regards

 

Depends - if you want to be 100% certain that you capture the state change of the switch, I would certainly recommend a debounce mechanism. If it's just for a test, maybe you could go without the debouncer.

Remember you will need some clock ticks (4..) over a 100ms time span to design a good debouncer. Just check over this period if the state is stable (0 or 1)

When a clock is available with 20ms period, then it takes 5 FFs.

Regards
 

I vote yes on the debounce. Flipflops are cheap. Your time debugging weird stuff due to glitchy inputs is not.
 

Debouncing and noise/disturbance filtering are two different things.

If you only need debouncing, the simplest way is just to sample the switches with a time period longer than the "bouncing" time.
I have successfully used 20 ms as the time period.
A longer time is ok, but if the time is too long, the user will notice a delay.

It doesn't matter if you sample in the middle of the bouncing noise
and get a random value, since that only happens when the switch is operated.
The previous and the next value will be stable (and different),
so whatever the random value is, the edge will be clean.
 

dear all

i have virtex 2pro30 kit so i configured one switch for reset if i pressed on it
but i did not make any debounce code just simple check on state of switch
is the debounce necessary or not?
aslo about debounce code if i designed it using FSM "showed in image ' can i know how many flip flop is used?

wait your help
regards


at least 8 FF
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top