cd4021b in daisy chain  - how many can I use?

I'm working on a project which will require reading around 50 switches. Will I encounter any issues linking 7 CD4021B's together in a daisy chain in order to get enough inputs? I don't need any other i/o, so would would it be better to daisy chain in pairs only? That way I'd have 3 pairs + 1 using 12 digital pins.

Also, can someone explain the difference between CD4021B and CD4014B? I know it's the difference between asynchronous and synchronous parallel input.. but what does that mean for me?

Any other options for getting 50+ digital inputs?

Thanks.

Any other options for getting 50+ digital inputs?

When my only tool is a hammer everything looks like a nail, but... :slight_smile:

You might want to consider using something like the SPI 8-bit I/O expander MCP23S08 (sample-able) from Microchip, I've written about my experiences here:

http://code.rancidbacon.com/LearningAboutArduinoMCP23S08

(I have intentions to turn my rough code into a library, but...)

More likely you'll want to use the 16-bit MCP23x17 variation which I have on hand but not yet tried.

With the 16-bit version presumably you could get 48 (or 64) inputs with 3 (or 4) chips and only need one SPI chip-select line as you can address up to 8 devices using the one chip select line. If you're more into I2C you could also use that although I haven't tried it.

The bi-directional nature of these devices might be overkill for your situation--I have no idea of the price difference between these chips and what you were already considering.

Other potential solutions might be to lay your switches out in a matrix to reduce the number of inputs needed or use a resistor-ladder type arrangement with an analog input. I guess it depends a little on the switches you're using.

Hope this information might be helpful.

--Phil.