Push button problem

Let's talk about anything related to the 6502 microprocessor.
Post Reply
raghuprabhu
Posts: 2
Joined: 02 Apr 2024

Push button problem

Post by raghuprabhu »

I am building a circuit for a stop watch interface.

When I click the push button 'Star / Stop", the LED "Clock Started" should light up.

It is happening in my case but after a delay and I have to hold the push button down for a long time.

When I click the "Start / Stop" again the LED should shut down instantly instead of me holding the push button for a long time. (2-3 seconds)

The following is inside the "start" subcircuit.

How do I get rid of this delay?
Attachments
Screenshot 2024-04-07 123833.png
Screenshot 2024-04-07 123759.png
Screenshot 2024-04-07 123050.png
User avatar
Yuri
Posts: 371
Joined: 28 Feb 2023
Location: Texas

Re: Push button problem

Post by Yuri »

The issue is that you have your push being effectively gated by your clock, so you have to hold the button until the next clock pulse.

In the case of Logisim you don't really need to do all of that as the button is already "debounced" so the following will work just fine:
Screenshot 2024-04-07 043725.png
Screenshot 2024-04-07 043725.png (10.88 KiB) Viewed 2152 times
In the real world though you'd want to debounce the button so that you get one clean pulse instead of lots of noisy little pulses from the mechanics bouncing and scraping against each other.

In the case of the JK circuit above this would happen with the clock pulse filtering out the noise; and as such the clock in a real circuit would likely be running much faster than you can perceive, however, in Logisim everything is slowed way down so you can see the circuit actually running.
Post Reply