2018-02-19 01:58 PM
Hello guys.
I've started working with stm32f217zg series and i have a problem with external interupt.
I have programmed the mcu and after i push the button the interupt occurs two times instead of one.
I use cube mx to generate the code.
I attached the code so you can see it.
2018-02-21 04:45 AM
There are much better ways to debouncing than to put a big fat delay routine in the isr, of all places.
2018-02-21 05:36 AM
Agree, delays inside of interrupt handlers, especially of this magnitude, tend to be deadly for serious applications.
There are other, better ways to prevent EXTI from generating switch transition events.
2018-02-21 05:55 AM
I wouldn't be too quick to declare a success. Your earlier posts suggested that the readings are always two times of what it should be . Switch bounces are fairly random and it is hard to imagine them being so consistent.
As to debouncing strategies, the best way to debounce is not having to debounce. I have done my fair share of software debounces and I can tell you from experience that no software debounces beats out a small capacitor for simplicity and effectiveness and robustness.