Skip to main content
JGaby.1
Associate II
March 24, 2022
Solved

Distinguish between PA and PB external interrupts

I am trying to understand the external interrupts for the STM32F103C8. It seems that I can attach an interrupt to any of the PA or PB pins. The first 5 pins (0-4) seem to have unique IRQ handlers, whereas pins 5-9 share a handler as does 10-13. When using the shared handlers I can tell which pin generated the interrupt by inspecting the PR register. However if I assign an interrupt to PAx and to PBx, they both seem to vector to the same place and I cannot distinguish whether it came from PA or PB. Is there a way to tell or should I never assign an interrupt to the same number PA and PB pins?

Thanks.

This topic has been closed for replies.
waclawek.jan
waclawek.janBest answer
Super User
March 24, 2022

> However if I assign an interrupt to PAx and to PBx,

You can't. You have to choose: either PAx, or PBx :

0693W00000LvfrEQAR.png 

JW

1 reply

waclawek.jan
waclawek.janBest answer
Super User
March 24, 2022

> However if I assign an interrupt to PAx and to PBx,

You can't. You have to choose: either PAx, or PBx :

0693W00000LvfrEQAR.png 

JW