Hi
A new project and a new problem.
For my current project I need to control 8 CMOS spst switches.
My proposed set up is 8 momontary push button switches:
two banks of 4 which control different functions.
(1 to 4) bank 1 and
(5 to 8) bank 2 are to control spst cmos switches (switches are normally open).
I need to have multiple combinations ie. 1,3,5 & 7 or 2,4,5 & 8 etc or possibly all switches closed or just 1 switch open.
My initially thoughts where about using a CD4021 (as I happen to have one) 8bit parallel to serial shift register, as used in the Shift in tutorial to read the 8 buttons, Then shift out the bits to a 74HC595 shift register controlling the cmos switches (CD4066) or alternately use the MAX335 (8 spst cmos switches, has a built in shift register and can be used on the SPI bus). A serialy connected 74HC595 would be used to contol LED's indicating the status of the switches.
Reading the Shift In tutorial and various tutorials on the web (toxicstuff and Nick Gammon web pages), I get the impression that the functionality that I require is not available from using the CD4021 or 74HC165. In that a a single push of any of the momentary push buttons will overide the existing state; and multiple button combinations is not possible. I have read the relevent section about mechanical switches buttons etc in the playground, and didn't find any information there, or maybe I missed it, same with searching the forum.
Now for my Questions:
Is there a way of latching the shifted in bits so that a switch will remain closed (LED lit) until its corrisponding control button is pressed again? If so could someone point me in the right dirrection.
Should I be thinking of the momentary push buttons as a key pad?
I have woundered if there is an alternative hardware solution?
Would it be simpler to use an I / O expander (PCF8574) and connect the control buttons to it, but I still don't see how to go about latching the switches.
Any advice or pointers as to hardware selection, or software would be gratefully received.
I think this is possible and I bet the solution is a lot simpler than I imagine.
best regards
Kevin