D flip-flop

Discussion in 'The Projects Forum' started by jt21, Oct 10, 2009.

  1. jt21

    Thread Starter New Member

    Oct 10, 2009
    7
    0
    Hi all,

    I am currently doing a project that involves a 74ls74ap, which is a dual d type flip-flop. The set and reset of the 2 d flip-flops are at +5v. Both flip-flops have the same clock frequency.

    A push button is connected to the input of D1. Output Q1 is connected to a AND gate input and input D2. Output D2bar is connected to the same AND gate and the AND gate output should output a "high" whenever the push button is pressed. So basically, this is a single pulse circuit design.

    Now the problem here is, even though I didn't press the push button, Q1 is always at logic high, making the output of the AND gate always at logic low.
    Is there anyway to make the output of Q1 low and go high only when I press the push button?
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    TTL logic should always have inputs pulled high through a resistor. 10K is a good value for 74LSxx.
    What does the D input look like? Is the input normally high, and get pulled down to ground through the PB? If is is left to float, the input will oscillate rith at the logic trip point, and the gate is quite likely to fail rapidly.

    Think about how a flip flop works. The Q output assumes the D input state with each valid clock (the falling edge, for a 7474).

    A schematic might be useful.
     
  3. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Post your schematic. A schematic says a thousand words, and makes it much easier to spot errors.
     
  4. jt21

    Thread Starter New Member

    Oct 10, 2009
    7
    0
    [​IMG]

    This is my design of the D flip-flop. The output of Q1 should be low until the push button is pressed, then Q1 turn high.
     
  5. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    OK, you have the resistor on the wrong side of the switch. When the switch is open, the input is "floating".

    Try it like this:

    [​IMG]

    R2 limits the maximum current into U1.
    R1 provides a discharge path to ground when S1 is open.
    R3 limits the current through LED D1.

    Note that if you're running in digital simulation mode, you will need to place a jumper across R2 for it to work. Circuitmaker doesn't simulate resistors well in digital mode, but you can't press the pushbuttons in analog mode.
     
  6. jt21

    Thread Starter New Member

    Oct 10, 2009
    7
    0
    Thanks for your help. I got it running to what I need already. Thanks.:)
     
Loading...