Hi everybody,
I am trying to use the interrupts of the mcp23017 with the raspberry Pi.
I am writing my own python interface for the module, so I am just using the RPi.GPIO library for detecting the state of the interrupt pin and smbus python module to communicate with the mcp23017 by i2c.
I easily managed to input and output when asked, but what I would like to do is to have interrupts when the state of any of the pins of the "B side" changes.
So I bridged together INTA and INTB pins and connected to the GPIO 7 of the RPi.
Then I did the following
>>> G.bus.write_byte_data(G.DEVICE, G.IODIR_B, 0xff)
>>> G.bus.write_byte_data(G.DEVICE, G.DEFVAL_B, 0)
>>> G.bus.write_byte_data(G.DEVICE, G.INTCON_B, 0)
>>> G.bus.write_byte_data(G.DEVICE, G.GPINTEN_B, 0xff)
but if I press any button (I have a button for each B pin ) and then I query the GPIO 7 pin, it always shows 0
What is interesting that before sending the above data to the mcp23017, the GPIO 7 pin shows 1, so it is connected correctly.
Maybe I am missing something.
I appreciate your help
Bob