cancel
Showing results for 
Search instead for 
Did you mean: 

Pushbutton causing multiple ISR flags (EXT-> PR) to set??

SWenn.1
Senior III

So I have three switches (nothing special just momentary push button) wired into the board PC2, PC3 and PA4. All are using internal pullups. PC2 and PC3 are set for rising / falling trigger IRQs and PA4 is set for falling IRQ. They all have their own ISR function and use a single callback. I am monitoring EXT -> PR register (interrupt flag) and I notice that when I push one of the buttons it will sometimes set 1, 2 or even all 3 of the flags and I never touch the other buttons. Here is an example of me pushing PC2 and 2,3,4 all went off. Sometimes only the one I want goes off as I would expect but many times multiple flags get set. There is nothing else on top of the board. It is a Nucleo-F401RE. Any ideas as to what could be going on here as I am totally confused?

SWenn1_0-1732482589937.png

 

10 REPLIES 10

So, with two discrete components per button, EXTI interrupt, over 40 lines of code and hardware timer you've managed to achieve what's easily possible without discrete components nor EXTI, using just 5 lines of code per button in SysTick ISR. ;)

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice