0

The goal is to implement a circuit in hardware with 2 inputs (A, B) and 2 outputs (A On, B On). An input (button press) toggles it's respective output, but also turns off the other output.

State diagram:

enter image description here

I've tried modifying a T-flop solution from the related question, but I can't get it to work.

Related to: Make a momentary switch control a toggle

EDIT:

  • By a button press I mean a transition (positive or negative)
  • To clarify the states:
    • 'A On' means A is on, B is off
    • 'B On' means B is on, A is off
    • 'Off' means A is off, B is off
  • Off is the initial or reset state
andrey
  • 504
  • 1
  • 5
  • 18
  • 1
    I am finding your question to be confusing. Do you want two separate buttons? If so, your state diagram is both not complete as well as misleading. You need to show BOTH outputs and all state transitions. – Dwayne Reid Jul 10 '20 at 18:54
  • Should that infinitely switch between A on and off if i press and hold a? – uglyoldbob Jul 10 '20 at 19:06
  • what if both A and B are pressed simultaneously by the user? and what is the state on reset? – Sanmveg saini Jul 10 '20 at 19:29
  • I've amended the OP, hopefully that clarifies things. – andrey Jul 10 '20 at 19:39
  • Does the system start with both A and B Off? Do you need to get to the "Both Off" state after having A or B on? – Peter Bennett Jul 10 '20 at 19:58
  • @andrey To include debouncing, you'll want at least 7 states, not three. This will also take care of combinations that may lead to conceptual difficulties, as well. (Such that if B is pressed but not yet released and then A is pressed before then, what is supposed to occur? Stuff like that.) – jonk Jul 11 '20 at 03:18

2 Answers2

2

schematic

simulate this circuit – Schematic created using CircuitLab

Give that a try and see what happens. It's assumed the inputs are low true, pulled up and debounced external to the schematic.

  • I'm having trouble getting this to work. In my test, I set INA to 1 and put a 1Hz clock on INB. It doesn't work as I would expect -- OUTB being the inverse of INB. – andrey Jul 22 '20 at 21:42
  • Is this in simulation or on the bench? Can you post a schematic? One thing to note is that these registers operate on the positive clock edge--the low period of the input sets the latch, and the rising edge activates the flip flop once the latch has settled. – Cristobol Polychronopolis Jul 23 '20 at 14:01
  • In the CircuitLab simulation. Same schematic. INA is held high, INB is pulsed -- https://imgur.com/a/b8aOKOj. Also simulated using LTSpice, got a different, but wrong, result -- https://imgur.com/a/3qe2orZ – andrey Jul 23 '20 at 20:33
  • The CircuitLab simulation looks like exactly what I'd expect...each time INB goes high, OUTB toggles. Since INB is in the foreground, when you can't see OUTB it's because it's in the same state as INB. That's how I understood your description of the behavior...if you push B while it's in state B_on, it goes back to off. Not sure about the LTSpice one, it doesn't even look like the latch is acting properly in that simulation. – Cristobol Polychronopolis Jul 24 '20 at 13:56
0

Here's a scheme using two latching push button switches with 1NO + 1NC contacts.

enter image description here

The bulb loads shown are illustrative.

vu2nan
  • 15,929
  • 1
  • 14
  • 42