I'm using an IO Expander chip, this gives me 8 digital inputs. When any pin changes level, I get an interrupt.
I2C isn't the best protocol in that situation. At 400kHz it will take on the order of 8 milliseconds to receive a response even if you could respond to the interrupt immediately. If my suggestion doesn't work fast enough you might have to rethink the overall design.Pete
I'm using an IO Expander chip, this gives me 8 digital inputs. When any pin changes level, I get an interrupt. The states don't latch, so at that instant I need to capture the state of all of the pins.
Thanks for the suggestion, the port manipulation stuff looks interesting. For this particular project, we're fixed on I2C and an Uno board (executive decision from above). We're going to have several of these port expanders, both for more I/O and to reduce the wiring required, so unfortunately wiring direct to the Arduino isn't possible. Our device will have a lot of modular hardware, many inputs and many outputs, and with I2C we only need to run 2 wires to each module. We will be instructing hardware to do things, and receiving interrupts when events happen. We have to detect the event and then control the hardware accordingly. It worked great wired directly to a Mega 256, so now we're moving to the Uno to reduce per-unit costs. It looks good on paper anyway..