Momentary Push Button as Toggle Using SR Latch

Thread Starter

kelladuck

Joined Sep 21, 2017
4
For a project I need to use an oscillator to increment a seven segment and then pause the segment after a push button is pressed. According to my teacher, this can be done using an SR latch.

I've tried it using a D Flip Flop and managed to get the counter to increment and then pause when the push button is pressed, but it continues after the button is released again. I also managed to get it to start out paused, and then begin incrementing after the button has been pressed, but that's the closest I've gotten.

I'm not really sure where to start with the SR latch. Should the push button be controlling the set or the reset?
 

crutschow

Joined Mar 14, 2008
25,389
What should happen when the button is pressed again?
Should the counter again start?

You likely need to debounce the push button output.
 

Thread Starter

kelladuck

Joined Sep 21, 2017
4
What should happen when the button is pressed again?
Should the counter again start?

You likely need to debounce the push button output.
We're using multimedia logic to simulate the circuit. When the simulation starts the counter should start increasing and then when the push button is first pressed the counter should pause.

We've never done debouncing before so I'm not sure what that would involve.
 

crutschow

Joined Mar 14, 2008
25,389
So this is only a simulation?
Debounce is only required for a real switch.

You didn't answer my question about the second button push.
 

Thread Starter

kelladuck

Joined Sep 21, 2017
4
So this is only a simulation?
Debounce is only required for a real switch.

You didn't answer my question about the second button push.
Yes we're just using software to simulate the circuit.

Sorry I think I misunderstood your question. The teacher didn't specify what should happen after the button is pressed a second time, but I would assume the counter should resume incrementing?
 

crutschow

Joined Mar 14, 2008
25,389
I would assume the counter should resume incrementing?
Well, that makes a difference in the design.
For that you need a flip-flop, as you used, not an RS latch.
So you would connect the D input the the /Q output to make it a toggle flip-flop, and use the push button to trigger the clock input.
The set and reset inputs are not used.
 

Thread Starter

kelladuck

Joined Sep 21, 2017
4
Well, that makes a difference in the design.
For that you need a flip-flop, as you used, not an RS latch.
So you would connect the D input the the /Q output to make it a toggle flip-flop, and use the push button to trigger the clock input.
The set and reset inputs are not used.
I tried that in multimedia logic and was given an error, but then I tried it using a different software and it worked fine. So I'm not sure what the problem there is, I'm going to ask my teacher tomorrow. Thank you so much for your help!
 
Top