AnsweredAssumed Answered

Setting falling edge interrupt STM32F205RBt6

Question asked by A2 on May 5, 2014
Latest reply on May 6, 2014 by sung.chen_chung
I want to set falling egde interrupt for PA15. I did below setting, but problem is interrupt occurs on both edges.
Pin is pulled up by 2.7K register to 5V.
I debug the code RTSR register has bit15 = 0, i.e rising edge disabled.
Didn't change RTSR & FTSR anywhere else in code.


void EXTI15_10_IRQHandler(void)
{
     /* clear isr flag */
EXTI->PR = REG32_BIT_15;

// do something

}

void init()
{
/* make as input encoder I */    
    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
    RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
  
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
    GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;
    GPIO_Init(GPIOA, &GPIO_InitStructure);
  
    SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOA, EXTI_PinSource15);
  
    EXTI->PR = REG32_BIT_15;
    EXTI->FTSR = (0xFF800000U & EXTI->FTSR) | REG32_BIT_15;
    EXTI->IMR = (0xFF800000U & EXTI->IMR) | REG32_BIT_15;
    
/* Enable and set EXTI Line2 Interrupt to the lowest priority */
    NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQn;
    NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x00;
    NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x00;
    NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
    NVIC_Init(&NVIC_InitStructure);

Outcomes