cancel
Showing results for 
Search instead for 
Did you mean: 

PB1 and PA1 are using the same EXT1?

Carter Lee
Associate III
Posted on October 17, 2017 at 10:45

Hi.

I'd like to use external interrupt PA1 nad PB1 pin.

But I found the following image, I think I can't use the external interrupt PA1 and PB1. Probably I think I have to  use only one to interrupt set.

Can I separately set to the one EXTIx?

because before system already use PB1 for external interrupt 

/* PB1 is connected to EXTI_Line0 :: Configuration AFIO_EXTICRx */

GPIO_EXTILineConfig(GPIO_PortSourceGPIOB, GPIO_PinSource1);

/* EXTI Line0 Configuration */

EXTI_InitStructure.EXTI_Line = EXTI_Line1;

EXTI_InitStructure.EXTI_LineCmd = ENABLE; /* Enable interrupt */

EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; /* Interrupt mode */

EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising;

EXTI_Init(&EXTI_InitStructure);

/* Enable and set EXTI0 Interrupt to the lowest priority */

NVIC_InitStructure.NVIC_IRQChannel = EXTI1_IRQn;

NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x01;

NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x01;

NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;

NVIC_Init(&NVIC_InitStructure);

but I want to add another external interrupt PA0,PA1,PA2,PA3. in this situation, what am I supposed to do ?

0690X00000608aCQAQ.png
1 ACCEPTED SOLUTION

Accepted Solutions
Szymon PANECKI
Senior III
Posted on October 17, 2017 at 11:51

Hello Carter Lee,

Your assumption is correct. Because of the fact, that EXTI1 is connected to all Px1 pins (PA1, PB1, PC1, ...), only one of them can be used as a source of interrupt in one time. So in your case it can be either PA1 or PB1.

Regards

Szymon

View solution in original post

2 REPLIES 2
Szymon PANECKI
Senior III
Posted on October 17, 2017 at 11:51

Hello Carter Lee,

Your assumption is correct. Because of the fact, that EXTI1 is connected to all Px1 pins (PA1, PB1, PC1, ...), only one of them can be used as a source of interrupt in one time. So in your case it can be either PA1 or PB1.

Regards

Szymon
Uwe Bonnes
Principal III
Posted on October 18, 2017 at 11:24

It is a pity that ST uses a multiplexer for the EXTI inputs and not a gated OR with a bitmask for selected active inputs.