Keil Logo

GENERAL: INTERRUPT HAPPENS MANY TIMES


Information in this article applies to:

  • C51 All Versions
  • C166 All Versions
  • C251 All Versions
  • CARM All Versions

QUESTION

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?

ANSWER

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.

Last Reviewed: Thursday, May 26, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.