AnsweredAssumed Answered

External interrupt react on rising edge only

Question asked by jan siroky on Sep 20, 2017

Hi everybody.

 

I am playing with stm32f411 and external interrupts. I have trouble with interrupt calling in the moment i need. Could you please take a look at my issue?

 

Id like to call the interrupt by user button pc13. The pin pc13 is pulled up. When the button is pressed, the pin pc13 is connected to the ground (falling edge). But whatever i set on interrupt setting (falling edge/rising edge), the interrupt procedure is called only leaving the button ("unpressing" it) (rising edge). 

 

here i put the setting of the interrupt that i use. 

void ext_int_pc13_conf()
{
RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN;                  // syscf clk enable
RCC->APB2RSTR |= RCC_APB2RSTR_SYSCFGRST;            // syscf reset
RCC->APB2RSTR &= ~RCC_APB2RSTR_SYSCFGRST;

SYSCFG->EXTICR[3] = SYSCFG_EXTICR4_EXTI13_PC;       // pin set as a trigger of ext interrupt
EXTI->IMR |= EXTI_IMR_MR13;                                                 // interrupt masking
EXTI->RTSR |= EXTI_RTSR_TR13;                                            // interrupt trigger on rising edge
EXTI->RTSR |= EXTI_FTSR_TR13;                                            // interrupt trigger on fallingedge
NVIC->IP[EXTI15_10_IRQn] = 0x4;                                           // priority setting
NVIC_EnableIRQ(EXTI15_10_IRQn);                                        // interrupt enable
return;
}

 

Thx for any idea!

js

Outcomes