Almost OT: Pushbutton switch latching

dave06a at dunfield.com dave06a at dunfield.com
Wed Dec 5 02:49:06 CST 2007


> Picture this - a number of switches, say, eight.  Momentary contact,
> normally open switches.  And then eight outputs, one for each switch,
> TTL level.  I want to be able to push one switch and bring [its]
> corresponding output high, and have it stay high even when the switch
> is released.  But, making this more complicated, I only want to be
> able to allow one switch to be active at a time.  So, say switch four
> is pressed, output four is high.  Then, switch one is pressed, and
> output four goes low, and output 1 goes high.  Timing is not
> critical.

Generate a pulse when any switch is pressed (AND them together and
drive a one-shot) - use this to latch the inputs from the switches to the
outputs. So any time a switch is pressed, the current state of the switches
is latched. The latch should be triggered at the trailing edge of the pulse.

Side effects which may or may not be significant:

- The timing of the pulse will provide debounce - the switches will
  have this amount of time to settle before they are latched.

- If you press (and hold) two switches within the period of time of the
  pulse, you will get two outputs latched.

Dave

-- 
dave06a (at)    Dave Dunfield
dunfield (dot)  Firmware development services & tools: www.dunfield.com
com             Collector of vintage computing equipment:
                http://www.classiccmp.org/dunfield/index.html



More information about the cctalk mailing list