could anybody please help with some logic?

Thread Starter

kutalinelucas

Joined Nov 20, 2007
98
hi.

I'm a bit stuck and i'd really appriciate any kind of help.

i have 5 switches with keyboard style action, with 32 different possible conbinations of output (ie 32 different combinations of keys being pressed at the same time). I would like the logic state of the 5 switches to be valid only when the first of the held keys has been released.

in other words if you imagine 5 keyboard style keys on a pcb numbered 1 - 5, if i wanted to send 1,2 and 5 high, i only want that conbination to be valid when i let go of one or all of the buttons.

once one of the originally held buttons goes low, the state (ie 1,2 & 5 = high, 4 & 3 = low) is sent to a 5-32 line decoder and the inputs are cleared, so a single positive going edge from switches 1,2 and 5 are sent when any one that has been pressed is released, regardless of weather the remaining switches still have physical contacts. when each of the switches is released, the process repeats.

Im not sure if im asking alot or there is a fairly simple solution, but any help or direction would be superb. thanks.
 

beenthere

Joined Apr 20, 2004
15,819
Life would be easier with a small microprocessor doing this function. The fun part is that any one of the five inputs going low from a high should save the state of it and the other 4 before the significant one went low.

That gives you 32 possible states to look for, and then a change from that is the latch trigger. I think the discreet logic would be awfully clunky, as you are trying to save a state previous to the latch enable. I would strongly recommend the microprocessor as the way to do this.
 

Thread Starter

kutalinelucas

Joined Nov 20, 2007
98
could you possibly point me in the right direction to what microprocessor to use?
I have a little experiance in vhdl coding an fpga, asm coding a 8051 through a teaching board and some c++, but thats about it, so im not so confident.

Is there anyway you could suggest a particular processor and maybe a resource where i could learn how to program it to do the above? i'm more than happy to read up on any resources
 

beenthere

Joined Apr 20, 2004
15,819
Any of the smaller PIC microprocessors could be useful. There are some with an 8 pin SOJ outline. Microchip (the manufacturer) has a web site with lots of application notes, and our site has dozens of threads dealing with PIC's.

If you can write assembler, coding should be no problem. The trouble with discreet logic is trying to latch a past state - sort of a challenge. All a PIC has to do is look at the internal register holding the key states one keypress interval before, and the job is done.
 
Top