Go Down

Topic: PCF8574 interrupt questions (Read 1 time) previous topic - next topic


I can't find a really good explanation on specifically what the interrupt pin exists to do on the PCF8574/PCF8575 pin expanders. I'm assuming it alerts you when a state has changed on one of the pins? (but I also see comments on the timing/clock in many threads on the subject)

Is it possible to use such a port expander without using the interrupt at all? (if you poll it when you expect changes?) and is it even necessary at all for output pins?  I was curious to try to use one of them to expand the number of devices that could be controlled on short-pinned devices such as ATTiny chips or the ESP-01. But in some cases you end up with just the two pins (without micro-soldering onto the controller pin yourself) especially with the esp-01.


You can leave the interrup-pin unconnected if you don't want to use it.

It's an output from the PCF8574 - it will change state if any of the inputs on the PCF8574 changes, and it can then wake a microprocessor from sleep so it reads the changes, and decide what to do.

// Per.


See my examples and library how you can use PCF8574 without interrupt.


In the example sketches I poll the PCF8574 to see if there are values changed.
This costs time especially when nothing has changed. This is where the interrupt comes into action.
It can signal the Arduino that one of the pins have changed and that the Arduino should read it.
This minimizes the overhead of the polling at the expense of a possible complex interrupt routine.

The library has no interrupt examples, I might write one if time permits.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up