AnsweredAssumed Answered

Debouncing interrupts

Question asked by carter.bob on Mar 10, 2013
Latest reply on Mar 14, 2013 by carter.bob
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

Outcomes