[sdiy] Pressing buttons

Batz Goodfortune batzman at all-electric.com
Mon May 13 07:00:16 CEST 2002


Y-ellow all.
         I just thought I'd throw in a novel solution I came up with years 
ago to the problem of "Many switches." This isn't for the faint hearted but 
it works a treat. And I should mentioned up front the exact details escape 
me for the time being but you'll get the idea.

In a word. "EPROM".

What you do is drive your array of momentary buttons directly into the 
address  pins of an EPROM. Of course, each button going high selects a 
different location in the EPROM. If that location is programmed with the 
required output  pattern on the other side of the EPROM then you've got the 
basis of a custom switching matrix. You're probably with me already on this 
but you need an EPROM blaster.

You have say, 12 address pins but only 8 outputs. OK. well how about this 
then. Take the first 4 of your output pins and drive them into a 74xx154 
(Is it the 154 or the 150?) 4 line to 16 line mux. So, if all the relevant 
locations are programmed with a 4 bit binary word, you can select one of 
the first 12 outputs on the 154. But wait there's more! A free set of steak 
knives.

At this point the outputs are momentary but that also means you can do 
whatever you want with them. And don't forget you still have the other 4 
uncommitted outputs from the EEPROM. Say you needed all 12 outputs in a 
switching rank (similar to that described) you can drive those into a JK 
flipflop or an RS latch. All the "R"s (resets) can be tied to a single 
output from the EPROM which is programmed with a "1" at every address 
location that the switches address. Press any switch and all 12 flipflops 
are reset. BUT! because the Set is also selected, it is usually the case 
that the "SET" pin will take precedence over the reset pin due to the 
slight propagation delays between the EPROM and the 154. So they all reset 
then set the next switch.

If that doesn't work (And it usually does) you can put a small one shot on 
the reset line. Since the user will always hold the switch for a longer 
period than the oneshot.

Another method is simply to put a 4 bit latch on the 4 outputs and use 
another EPROM output pin to strobe the latches. Key goes down, latches 
open, Key released latches closed. The 4 bit output always contains the 
binary number of the key pressed.

The beauty of this is that it's inherently self-de-bouncing. It can only 
change state it can't re-trigger. You can set it up in any configuration 
you want. For example my application required there to be 2 ranks of 
switches. one a bank of 4 and the other of 8 controlling 2 different 
things. And it rejects false triggering since if you hit 2 or more buttons, 
you address a part of the EPROM which hasn't been programmed or programmed 
to null. Nothing happens. Or you could get even tricker and program it so 
that various key combinations do various other things. Whatever you need.

In my application it was some fairly complex audio routing using some 
bi-lateral (type) switch chips. (Numbers escape me for the moment but 
they're relatively common) I mounted the switching matrix right on the 
audio I/O connectors on the back and all I had to do was run 5 control 
wires up to it from the front. And all the audio I/Os are kept in a tiny 
little section up the back where they can live long and prosper.

So there you go. Mass switching bastard style.

Hope this helps.

Be absolutely Icebox.

  _ __        _       ____Happiness is a warm penguin____
| "_ \      | |
| |_)/  __ _| |_ ____       ALL ELECTRIC KITCHEN
|  _ \ / _` | __|___ |  Geek music by geeks for geeks
| |_) | (_| | |_  / /
|_,__/ \__,_|\__|/ /    Bullshit --> http://all-electric.com
                 / ,__   Music -----> http://mp3.com/electrickitchen
Goodfortune    |_____|        




More information about the Synth-diy mailing list