2018-04-22 06:59 PM
Hello,
- MCU : STM8L101K3
I am using Port A.2 for interrupt and Port D.2 for general gpio.
GPIO_Init(GPIOA,GPIO_Pin_2, GPIO_Mode_In_FL_IT);
EXTI_SetPinSensitivity(EXTI_Pin_2, EXTI_Trigger_Falling); GPIO_Init(GPIOD, GPIO_Pin_2, GPIO_Mode_Out_PP_High_Fast);In my scenario, Port D.2 is changed input to output mode per every 1sec.
if(onesec)
{ onesec = 0; GPIO_Init(GPIOD, GPIO_Pin_2, GPIO_Mode_In_FL_No_IT); // all led off if(redled) { GPIO_Init(GPIOD, GPIO_Pin_2, GPIO_Mode_Out_PP_High_Fast); GPIO_ResetBits(GPIOD, GPIO_Pin_2); // red led on } else if(blueled) { GPIO_Init(GPIOD, GPIO_Pin_2, GPIO_Mode_Out_PP_High_Fast); GPIO_SetBits(GPIOD, GPIO_Pin_2); // blue led on } else //led off { // nothing. } }If this condition is redled, The EXTI2_IRQHandler that will not expected is called.
The Port A.2's hardware line is not interrupted in oscillscope.
Please know me why
EXTI2_IRQHandler is called?
Thanks in advance.
2018-04-23 02:03 AM
Hello,
EXTI controller is designed is a way, that EXTI[number] is connected to all Px[number] pins. This means that EXTI2 IRQ handler will react on signal change on very pin, which has 2 in the name: PA2, PB2, PC2 andPD2. Pleas see below the extract from MCU's reference manual.
I believe that this could be an explanation of the bahavior, that you faced.
Regards
Szymon
2018-04-23 04:37 AM
,
,
Thanks.
I have one more question.
In output mode, level change is not affects to same interrupt's pin ♯ .
What is the exact meaning of the signal change? ,
Regards
leewonsoo