8-Bit Computer Button Debouncing

button debounce module


In this post, we’ll take a look at the button debounce module of my 8-bit computer. Ben used a 555 timer in his clock module to make a delay to debounce the button. I took a different approach. 

I took the 50 MHz input from the crystal oscillator and lowered the frequency by using another clock module. This way I have another slower clock signal independent from the main clock. This slow frequency is then fed into the debounce modules.

Button Bounce Problem

When a button gets pressed the two metallic contacts inside it will touch together completing the circuit. It often happens that some bounces/vibrations will occur when the contacts first touch resulting in a few voltage spikes.
This is problematic as it’s interpreted as multiple button presses when in reality the button was only pressed once.
To show the problem I used an oscilloscope to probe a button output before it goes through the debounce circuit.
Three presses of the button were made(see the first image). Everything seems fine but if we zoom in on the second button press you can see contact bounce occurring(see the second image). To fix this issue we have to debounce the button.

Button Debounce Circuit

There are a lot of ways to debounce a button. I used two D flip-flops feed by a slow clock signal from a secondary clock module(set up specifically to provide a slower clock signal just for the debounce modules).
The first flip-flop stores the current button value meanwhile the second flip-flop stores the previous value. If both values are 1 this means the button was being pressed for the length of the clock cycle and it wasn’t just a voltage spike from the contact bounce. Therefore a 1 will be output.
hardware button debounce circuit

Leave a Reply

Your email address will not be published. Required fields are marked *

The following GDPR rules must be read and accepted:
This form collects your name, email and content so that we can keep track of the comments placed on the website. For more info check our privacy policy where you will get more info on where, how and why we store your data.

Advertisment ad adsense adlogger