Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interrupt-on-change feature by setting INTCON register not working #36

Open
varun-s opened this issue Jan 4, 2021 · 1 comment
Open

Comments

@varun-s
Copy link

varun-s commented Jan 4, 2021

Using the MCP23017 to capture push button press.

Configuration:
mcp.interrupt_enable = 0xFF00 #interrupts enabled on port B
mcp.interrupt_configuration = 0xFF00 # Port B bits set, so corresponding I/O pin should be compared to DEFVAL register
mcp.default_value = 0x0000

Expected behavior :
interrupt should only be triggered when the button is pushed

Actual:
Interrupts are generated on both button push and 'pull' edges

@varun-s varun-s changed the title interrupt-on-change feature by setting INTCON register now working interrupt-on-change feature by setting INTCON register not working Jan 4, 2021
@flyte
Copy link
Contributor

flyte commented Jan 26, 2021

This might be caused by switch bounce, which makes the logic level rapidly switch between high and low multiple times when engaging or disengaging the switch.

http://www.labbookpages.co.uk/electronics/debounce.html

You can try putting a small capacitor across the switch terminals to see if it helps, as explained in the link above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants