IO Pi Plus interrupt-driven input
The IO Pi Plus is a 32 channel MCP23017 GPIO expander for the Raspberry Pi
15/06/2016
Posted by:
richp999
Hi,Another question on a similar topic - I am using this board to interface with a number of buttons.I have moved over to using Windows 10 IOT on my Pi 2.I have pretty much everything working, but am having trouble with the interrupts.I have the IA and IB connected via your level shifter to 2 gpio ports on the Pi. They are directly connected via the level shifter, no other components. Firstly is this correct ? I havent been able to find a schematic of how to connect the IA and IB pins to the GPIO ports.My interrupt is caught in the c# code on windows 10 iot, but I have having problems specifically resetting the interrupt afterwards.Watching the pin it starts low, when I press a physical button it goes high,. the interrupt is caught. But the the pin stays High from then on.I tried resetting the interrupt by reading PORT_EXPANDER_INTCAPx_ADDRESS (0x10 & 0x11) , but this doesnt seem to work properly.My code reads both these registers when either interrupt (A or B) is caught, in an attempt to reset both interrupts. Interstingly if I catch an interrupt on bank A, the interrupt on bank B will reset , and vice versa. So something is working, but for some reason it wont reset the interrupt on the bank it has just caught.I know most of your examples are in python, but do you have any ideas ?? Thanks..
15/06/2016
Posted by:
andrew
Hi
Have you tried using our Windows 10 IOT library for the IO Pi? It includes a ResetInterrupts() function in the IO Pi class for resetting the interrupts which should pull both of the interrupt pins low. Although looking at how the ResetInterrupt function works it does appear to be doing the same as you by reading the INTCAP register.
You may also find the interrupt pins are more reliable with a level shifter if you set them to be high by default so they go low when triggered. I am not sure why this is but it does seem to work more reliably this way. Alternatively, adding a 10K resistor to the interrupt pin and ground may help with making sure the pin pulls back low when it is reset.
Have you tried using our Windows 10 IOT library for the IO Pi? It includes a ResetInterrupts() function in the IO Pi class for resetting the interrupts which should pull both of the interrupt pins low. Although looking at how the ResetInterrupt function works it does appear to be doing the same as you by reading the INTCAP register.
You may also find the interrupt pins are more reliable with a level shifter if you set them to be high by default so they go low when triggered. I am not sure why this is but it does seem to work more reliably this way. Alternatively, adding a 10K resistor to the interrupt pin and ground may help with making sure the pin pulls back low when it is reset.
Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view.
Download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.