1
\$\begingroup\$

I'm working on a project where I am using two 4x4 button pads. I would need to use two MCP23017 for input interrupts to support the 32 buttons. I am using a Netduino and I'm coming across an issue that I'm uncertain if its software related or hardware related.

I am using this website as a guide to understand and configure the MCP23017 and I'm following all the steps, including the diagram below:

diagram

The diagram shows the address as set, SDA and SCL have a resistor, reset is biased, a pin on the Netduino is set to handle the interrupt, and a microbutton is used to test the interrupt functionality.

I set the MCP23017 pin for the switch as input, set it to use a pull up resistor, then set the pin as an interrupt. The pin on the Netduino is set to use a pull up resistor as well and to cause interrupts when low. This works perfectly fine as long as the Netduino boots up with switch closed. If the switch is open (as it is normally open) no interrupts ever fire. I need to start the Netduino while pressing the microbutton to get the desired behavior. I'm unsure as to what is causing this. I am exhibiting the same behavior as the person commenting on the bottom of this page.

Is there either a software or hardware solution to this?

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

1.7.5 INTERRUPT CONDITIONS There are two possible configurations that cause interrupts (configured via INTCON):

1. Pins configured for interrupt-on-pin change will cause an interrupt to occur if a pin changes to the opposite state. The default state is reset after an interrupt occurs and after clearing the interrupt condition (i.e., after reading GPIO or INTCAP). For example, an interrupt occurs by an input changing from ‘1’ to ‘0’. The new initial state for the pin is a logic 0 after the interrupt is cleared.

2. Pins configured for interrupt-on-change from register value will cause an interrupt to occur if the corresponding input pin differs from the register bit. The interrupt condition will remain as long as the condition exists, regardless if the INTCAP or GPIO is read.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.