Lots more digital ins and outs, best method?

Hello folks

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?

So best method for additional 16 in and 16 out?

Thanks
Jim

Well some might elect to use an Arduino Mega that has like 54 digital pins. :wink:

Lefty

Yup could do, although I thought it could be a good opportunity to learn multiplexing, or whatever it's called.

This is one way to do it:

Charlieplex the LEDs with this Charlieplex Library

Wire the buttons in a button matrix as a kaypad, and use this Keypad Library .
:slight_smile:

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.

(* jcl *)