Momentary Push Button as Toggle Using SR Latch

Discussion in 'Homework Help' started by kelladuck, Sep 21, 2017.

  1. kelladuck

    Thread Starter New Member

    Sep 21, 2017
    4
    0
    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?
     
  2. crutschow

    Expert

    Mar 14, 2008
    20,067
    5,651
    What should happen when the button is pressed again?
    Should the counter again start?

    You likely need to debounce the push button output.
     
  3. kelladuck

    Thread Starter New Member

    Sep 21, 2017
    4
    0
    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.
     
  4. crutschow

    Expert

    Mar 14, 2008
    20,067
    5,651
    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.
     
  5. kelladuck

    Thread Starter New Member

    Sep 21, 2017
    4
    0
    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?
     
  6. crutschow

    Expert

    Mar 14, 2008
    20,067
    5,651
    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.
     
  7. kelladuck

    Thread Starter New Member

    Sep 21, 2017
    4
    0
    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!
     
Loading...