Question
Debouncing interrupts
Posted on March 10, 2013 at 23:38
Hi,
In our system, we are trying to debounce switches on GPIO lines. Every msec the switch is sampled using TIM3. After 16 ticks, if the input has settled, the idea is to set the interrupt pending register and trigger the interrupt. E.g.simple code to illustrate if (db_count = 16) EXTI->PR = 0x00000200; else EXTI_ClearITPendingBit(EXTI_Line9); Is this code valid. ie Can I manually set the interrupt pending register like this. When I use this method, I never see the pending reg being set at all. Is there anything else I need to do in order to set this reg? Many Thanks Bob