cancel
Showing results for 
Search instead for 
Did you mean: 

The max number of external inputs using interrupt at the same time?

E-John
Associate III

Dear SIR,

What is the max number of external inputs using interrupt at the same time?

In my application, it uses 22 GPIO as external input as Fig.1.

1. I use STM32CubeMx to set "PB1" to "GPIO_EXT1" then set "PC1" to "GPIO_EXT1", after setting "PC1", the "PB1" change to unassigned state? it seems not allowed to set PinX1 at the same time? (see Fig.0)

I want to hook an interrupt for each external input, but it seems not workable after I see the document and code

see Fig.2, Fig.3 and Fig.4

2. The max external input using interrupt is 16, is my understanding correct?

3. If it supports more than 16 external input pins, how to set it in STM32CubeMx?

EJohn_0-1704118628368.png

Fig. 0

 

EJohn_0-1704117803540.png

Fig.1

EJohn_1-1704117991826.png

 Fig.2 

EJohn_2-1704118022312.png

Fig.3

EJohn_3-1704118037399.png

Fig.4

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

The max is 16, but for any given pin number, only one port can be active. So PB1 and PC1 can't be an interrupt at the same time. This is due to a hardware limitation as shown in the "EXTI GPIO mux" figure you posted.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

3 REPLIES 3
TDK
Guru

The max is 16, but for any given pin number, only one port can be active. So PB1 and PC1 can't be an interrupt at the same time. This is due to a hardware limitation as shown in the "EXTI GPIO mux" figure you posted.

If you feel a post has answered your question, please click "Accept as Solution".
MM..1
Chief II

And for detail at same time only one IRQ is active based on priority.

EXTI is limited to 16 , but when your reaction time isnt critical you can extend it pool gpio in timer interrupts, 

Or with some config you can use timer channels input as exti int.

Would suggest combining signals externally or using an io expander

TIM Input Capture pins

Scan in SysTick

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..