Skip to main content
Graduate
January 1, 2024
Solved

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

  • January 1, 2024
  • 3 replies
  • 4518 views

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

 

 

 

 

    This topic has been closed for replies.
    Best answer by TDK

    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.

    3 replies

    TDKAnswer
    Super User
    January 1, 2024

    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.

    Graduate II
    January 1, 2024

    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.

    Graduate II
    January 1, 2024

    Would suggest combining signals externally or using an io expander

    TIM Input Capture pins

    Scan in SysTick