2017-10-17 01:45 AM
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 ?
Solved! Go to Solution.
2017-10-17 02:51 AM
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
Szymon2017-10-17 02:51 AM
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
Szymon2017-10-18 02:24 AM
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.