GPIO pin kept low after falling edge?
Posted: Sat Jun 28, 2014 10:59 am
I am a beginner at electronics, so having difficulty and don't understand what I am doing wrong.
I have an MCP23017 which I am programming via i2c. This I am having no issue with. I have configured pin 1 on Bank B as an input and set up the registers to enable the interrupt pin. With a switch connected to the input pin of the port expander and an LED connected to the interrupt pin I can clearly see INTB as high until I press the switch. Reading from INTCAP resets the interrupt an d everyhing is fine.
So I connected the INTB pin of the port expander to pin 22 of the PI, and enabled this as input with the resister set to pull up (as the default state of INTB seems to be high). So when I press the button, INTB goes low and my script detects this correctly on the falling edge and reads from INTCAP to reset the register, however it never does reset and the LED connected to INTB is always off showing that it is still grounded. Pulling the wire from pin 22 if the PI, immediately INTB is high again (the LED is lit) showing that the read from INTCAP did indeed reset the interrupt.
Seems like after the pi has detected the falling edge, it is somehow keeping pin 22 to INTB grounded.
Anyone have any ideas? (Sorry for the long winded post)
Steve
I have an MCP23017 which I am programming via i2c. This I am having no issue with. I have configured pin 1 on Bank B as an input and set up the registers to enable the interrupt pin. With a switch connected to the input pin of the port expander and an LED connected to the interrupt pin I can clearly see INTB as high until I press the switch. Reading from INTCAP resets the interrupt an d everyhing is fine.
So I connected the INTB pin of the port expander to pin 22 of the PI, and enabled this as input with the resister set to pull up (as the default state of INTB seems to be high). So when I press the button, INTB goes low and my script detects this correctly on the falling edge and reads from INTCAP to reset the register, however it never does reset and the LED connected to INTB is always off showing that it is still grounded. Pulling the wire from pin 22 if the PI, immediately INTB is high again (the LED is lit) showing that the read from INTCAP did indeed reset the interrupt.
Seems like after the pi has detected the falling edge, it is somehow keeping pin 22 to INTB grounded.
Anyone have any ideas? (Sorry for the long winded post)
Steve
