cancel
Showing results for 
Search instead for 
Did you mean: 

External Interrupt in PORTB (Multiple pin)

RKuma.7
Associate

I configure the portB 4,5,6,7 as external interrupt pins. the program is working well if any interrupt occurs in portb 4,5,6,7 the execution send to irq. how to find which pin irq is occured in portb

please give the solution to my problem

2 REPLIES 2
S.Ma
Principal

look for PR bits in EXTI block.

They are set when the defined edge(s) occur.

Clear the PR bits after reading them.

Cristian Gyorgy
Senior III

What I do, is store a variable with the current status of the pins. In the interrupt I just read the current port values and compare it with the known status to see what pin has toggled.

You need to pay attention on how your system is setup. It also depends how the sensitivity bits are configured for the 4 pins.