I'm connecting to an arduino or raspberry pi and would like to have 256 io pins. I found a 16bit io expander which has 8 unique addresses for 128 but that's the max I can do on i2c. Any other thoughts on how to expand my io ports?
You can put an I2C Multiplexer in there between the Arduino and your devices, then only put one of each address on each downstream bus. A 1-to-2 Multiplexer that I've used with Arduino before is PCA9540BD,118. That will get you to 256 with the hardware and interfaces you are already using with the addition of one more component.
This is a solution if all you are looking for is low-speed output-only: 74HC595. http://www.nxp.com/documents/data_sheet/74HC_HCT595.pdf
I once used this chip for animating a lot of LEDs.
You can connect a chain of these chips together, so that the output of a Q7S goes to it's neighbor's DS. Then, take an SPI output of your main micro and connect it to the chain. The micro's SPI-MOSI should connect to the free DS chip and then SPI-CLK should connect, in parallel, to all of the SHCP pins. Then, use a free I/O to pulse all of the STCP pins. Your transmission should look like this:
- Transmit 8 bytes on SPI.
- Pulse STCP
Once you pulse the STCP line, all of the outputs will change.