I need more ins and outs than my Arduino Duemilanove provides. Specifically I need to control 16 LEDs and read 16 switches. I may need more but not more than another 8 of each.
I understand the concept/hardware in the ShiftOut/ShiftIn examples
But I was wondering if this was the best approach given that the chips have to be coupled/daisy-chained. Are there single chips to handle 16? Or even chips that deal with 16 ins and 16 outs?
I have seen a chip (STP something) that handles 16 outs but it's specifically described as an "LED driver". Presumably it can only be used as such?
The chips are called port expanders. Maxim makes the MAX73xx devices that
have from 8 to 16 I/O lines. Also TI and NXP make the PCA95xx devices with
8 to 16 lines.
Another idea would be to use a ATmega168. You could write a little program
that uses the SPI port (or UART or I2C) and reads the inputs and
writes the outputs.