4 latching buttons allowed to work one at a time

Discussion in 'General Electronics Chat' started by technerd805, Jul 21, 2011.

  1. technerd805

    Thread Starter New Member

    Jul 21, 2011
    2
    0
    I need help.
    I have 4 momentary push buttons that I have set to latch using an MM74C14 Schmitt and 2 CD4013 d flip-flops. I am trying to figure out how to accomplish the following scenario: with button A active, pressing buttons A,B, or C will deactivate button A and activate whichever button was pressed. The same rule would apply for all buttons so only one button could be active at a time and selecting a new button would deactivate the last active button.
    I tried doing this by toggling two switches from a CD4016 per button. one as the actual active output and the other to allow pulses from the non active buttons back into the active buttons path. It unfortunately failed to work.

    I know this can be done easily in code but the project this is for must be programming free.
     
  2. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    Do you mean: with output A active (High), pressing A,B, or C will deactivate output A ?

    Could you please explain better or post a schematic of what you built?
     
  3. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    I think they meant to say they had four buttons, A, B, C and D.
    If A is active, pressing B, C or D will reset A, and set the selected button's output active.

    If C is active, then pressing A, B or D would reset C's output and set the selected output active.
     
  4. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Well, here are a couple of ideas that should work.
    All diodes are 1N914 or 1N4148's. These are steering diodes, and must not be omitted - or you will have outputs fighting each other.
    The R1's are resistor networks that have a common ground pin. Individual resistors of the same value as shown could be used instead.

    In the 1st schematic, every button sets it's respective flip-flop, and re-sets the other three via the logic steering diodes. The 39k resistor network was used because each button will see 4 pull-downs at once when pressed; 39k / 4 = 9.75k.

    Then I remembered that if both SET and RESET of a 4013 are high, both the Q and Q\ outputs will be high, which lead to the 2nd schematic, a good bit more simple. It's also much more expandable than the 1st one; you could add on as many switches and flip-flops as the fanout of 4000-series CMOS supports.

    I didn't feel that de-bouncing the inputs was really necessary for these examples.
     
    Last edited: Jul 21, 2011
  5. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    Maybe I'm mistaken, but wouldn't the diodes from any of the /Q (if HIGH) maintain all resets always on HIGH and therefore maintain all /Q always at HIGH? And as he has momentary switches, this would immediately reset the output he just set?

    I see that the first schematic will work, though.
     
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Yep, those are problems all right. I'd done some more thinking about it, and initially thought I could fix the all Q\ outputs high problem by using 4081 2-input AND gates with the Q and Q\ outputs as inputs, output to the diode by the 4013's - but the Q\ being high when the set being released is still a problem; all Q's Off!

    Can't use the Q outputs to reset all the others without steering diodes, either.
     
  7. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    The first one is perfect. If that's what the OP meant. :)
     
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Well, here's another twist at it...

    Similar to the 1st one, but the Q output of one f/f resets the other 3 via steering diodes.
    So, 4 diodes fewer than the 1st schematic, but 2 different sizes of resistors are used.

    One thing that's lacking from these ideas is a power-on reset. That can be as simple as a cap from one of the SET inputs to Vdd, with another diode connected cathode to Vdd to that same input. That way when power is removed, the diode discharges the cap.
     
    Last edited: Jul 21, 2011
  9. technerd805

    Thread Starter New Member

    Jul 21, 2011
    2
    0
    thank you guys for all the info.... I've been looking for "radio button" schematics and there is less info available than i thought there would be. i will try your suggestions.
     
  10. n4icu

    New Member

    Oct 29, 2011
    1
    0
    Trying to remember how to use 4013's when I used to have build with TTL.
    Designing and using CMOS is new to my workbench. Thanks for discussions in this thread, now I think I know what I'm doing.
    Circuit I'm building is to turn on a Computer 25 miles from my home.
     
  11. crutschow

    Expert

    Mar 14, 2008
    13,014
    3,234
    Here's another approach. Connect the PBs (active high) to their respective D-FF D input. Connect all the PBs (use diode steering or an OR gate) to trigger a one-shot of say 100ms. Connect the one-shot output through an inverter to all the FF CLK inputs (CLK pulse goes low and then high).

    When a PB is pushed, the FF with the logic high at its D input will go high at the end of the one-shot pulse while all the other FFs go low.
     
    Last edited: Oct 30, 2011
Loading...