This forum is for posts that might be considered off-topic but that may be useful or interesting to members. Examples include posts about electronics or programming in general, other microcontrollers or interesting devices, useful websites, etc.
I have a need to mux together up to 16 digital inputs, made up of pushbutton switches and some toggle switches. I also want to add debounce and the ability to trigger an interrupt pin when one of the switches changes state.
So far I have been looking at the HP4067 A/D mux, the Max6816 debouncer and maybe a couple of octal input gates. However I have the feeling I am going about this all wrong and that there is an elegant solution out there that will do everything I want and not need more than I/O 6 pins.
Anyone have any ideas they would be willing to share?
cerickson wrote:So far I have been looking at the HP4067 A/D mux, the Max6816 debouncer and maybe a couple of octal input gates.
You might want to consider using an I2C I/O expander like the PCF8574 instead of the analog multiplexor. With that arrangement, you'd need the two I2C signals and one (or two) inputs for the state change interrupt.
You may be able to do the debouncing in software - you can find software debouncing code using and I/O expander on the Internet.
Hi,
Also you can use the PCA8575. It is a 16 bit digital input and an interrupt if one of the input signal changed. I never used it but it was in my list in case ran of inputs in one of my projects.
Hi,
You can use a resistor and capacitor to clean the contact closure bouncing or you can do software wise like as dkinzer already suggested. Also you can share the I2C signals for all the chips as long they have an enable chip signal. Just enable the one you want to address.