|ARM Technical Support Knowledge Articles|
Applies to: General Topics
Information in this article applies to:
I'm using an evaluation board to which I have added a few push button switches. The switches are connected to the external interrupt inputs through inverters. When I press a button to initiate a specific interrupt, the program seems to cycle through the interrupt twice and undoes the initial desired result. Is there something I'm doing wrong or missing here?
It sounds like the button you are using creates switch bounce when the contact is closed. If you are feeding the output of the switch into the interrupt, you must first debounce the switch using hardware. Refer to the schematic of our MCB520 evaluation board at http://www.keil.com/mcb520. We have switches on that board that feed into the external interrupts and our board has circuitry to de-bounce the switches.
If you can't add the hardware to debounce the switches, you will have to POLL the input for the switch and take several samples to determine if the switch is really PRESSED or RELEASED.
Article last edited on: 2005-05-26 11:39:04
Did you find this article helpful? Yes No
How can we improve this article?