04-01-2013, 10:56 AM
Debouncing a Switch
Debouncing.ppt (Size: 401.5 KB / Downloads: 27)
Causes
Switches and buttons are mechanical
Spring loaded
Contacts literally bounce
Not an instant, once-only, on↔off change
Source of Errors
Consider a 100 MHz system clock, which has a 10 ns period
Each ms would be 100,000 system clock cycles
Downstream circuitry will see every bounce as an input change!
FSM Solution
Simple enough that an FSM might not be required
Easy to concoct a sequential circuit to do this with a counter and a single FF
Let’s do it with an FSM
If solution requires only a counter and a single FF, we will find that solution
Debouncer Summary
Structure is timer + FSM
2-state FSM makes NS logic trivial
Asynchronous input “noisy” means we must be sure our system works with any input timing
If desired/needed, synchronize “noisy” input using one or more flip flops
Counter too large for conventional techniques
Use MUX + register technique of Chapter 12
Systems can usually be greatly simplified beyond the obvious design by using careful analysis