Skip to main content
jean_prieur
Associate III
September 19, 2013
Question

NVIC interrupts on two ports with same pin number

  • September 19, 2013
  • 7 replies
  • 3752 views
Posted on September 19, 2013 at 17:37

Hello everybody,

Is it possible to link same pin number of different GPIO ports on the same EXTI line ?

For example, create an interrupt on line_0 for the GPIO pin A0 and the pin B0. It seems impossible to achieve with the ST librairies - but I don't understand why it's impossible regarding to the internal schematic of the STM32F4... I really want to use more than 16 GPIO with interrupts. Is there a software way to perform this interruption ?

Thanks a lot !
    This topic has been closed for replies.

    7 replies

    Tesla DeLorean
    Guru
    September 19, 2013
    Posted on September 19, 2013 at 18:33

    NO, it uses an N-to-1 mux, only one bank's pin reaches the signal conditioning.

    [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Discovery/Handling%20multiple%20interrupts%20on%20single%20EXTI%20line&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&currentviews=193]Related Thread
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Tesla DeLorean
    Guru
    September 19, 2013
    Posted on September 19, 2013 at 18:37

    0690X00000604RMQAY.png

    0690X000006051hQAA.png
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    jean_prieur
    Associate III
    September 19, 2013
    Posted on September 19, 2013 at 18:56

    Thanks Clive, I just wanted to sure.

    Tesla DeLorean
    Guru
    September 19, 2013
    Posted on September 19, 2013 at 19:11

    Generally you'd use an external priority decoder to decimate the number of pins required on the CPU.

    Alternatively you could use TIMx_CHx pins in input capture mode, or poll slow GPIO sources. I'd recommend a print out of the Data Sheet with pin designations, and a high-lighter pen. Assign the TIM pins first, then the EXTI. Draw a pin vs bank matrix if that helps.
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    John F.
    Associate III
    September 20, 2013
    Posted on September 20, 2013 at 09:09

    For example. 74HC147

    10-to-4 Line Priority Encoder

    or 74HC148

    8-Line To 3-Line Priority Encoder

    . Also CD4532 from the old CMOS 4000 series.

    Also note on the STM32F4 family (STM32F405/407xx and STM32F415/417xx) this erratum -

    Configuration of PH10 and PI10 as external interrupts is erroneous

    Description

    PH10 or PI10 is selected as the source for the EXTI10 external interrupt by setting bits

    EXTI10[3:0] of SYSCFG_EXTICR3 register to 0x0111 or 0x1000, respectively. However,

    this erroneous operation enables PH2 and PI2 as external interrupt inputs.

    As a result, it is not possible to use PH10/PI10 as interrupt sources if PH2/PI2 are not

    selected as the interrupt source, as well. This means that bits EXTI10[3:0] of

    SYSCFG_EXTICR3 register and bits EXTI2[3:0] of SYSCFG_EXTICR1 should be

    programmed to the same value:

    • 0x0111 to select PH10/PH2

    • 0x1000 to select PI10/PI2

    Workaround

    None.

    sam
    Explorer
    March 31, 2014
    Posted on March 31, 2014 at 05:01

    wish it was ORed...

    John F.
    Associate III
    March 31, 2014
    Posted on March 31, 2014 at 09:25

    Then just use an external single OR gate such as the SN74LVC1G32DBVR (Texas version of 74LVC1G32 single OR gate). Alternatively, if you need a '0' OR (output low if either input low) the SN74LVC1G08DBVR AND gate will do.