I have the interrupt pin on a MCP23017 connected to PO.13 on G120
I am using the code below…
InterruptPort IntButton = new InterruptPort(Pin.P0_13, false,Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeHigh);
IntButton.OnInterrupt += new NativeEventHandler(IntButton_OnInterrupt);
When i start my application…the interrupt is fired when the MCP23017 is initilised but the interrut in fired after the first time. Do i need to clear the interrupt on the G120…i do clear the interrupt on the MCP23017
What does your interrupt handler do ? Show us it’s code… Also, check the datasheet of the MCP23017 and see what it says about clearing interrupts. Alternatively, you could step back to a simpler test, and use a button connected to a pin and see what happens with that to check your code works as you expect…
so the problem lies in your communication to the MCP23017 device. Define “lock up”? You have the ability to step into code, tell us where you’re getting to and what the behaviour is? You also mentioned looking at the data on the bus in the past, what is going on at that level?
@ anthonys - If the board gets locked up due to the frequency in which the interrupt is handled, you can try to disable interrupts on the pin at the beginning of processing, and re-enabled at the end, that is, if this kind of behavior is OK with the device as well as the data the device would be sending you.