AnsweredAssumed Answered

STM32F4 DISCOVERY wrong EXTI port

Question asked by kettunen.pasi on Mar 4, 2014
Latest reply on Mar 6, 2014 by Clive One
I'm trying to do a pin interrupt (EXTI).

My code:
// IRQ handler for EXTI0
void EXTI0_IRQHandler (void) {
  EXTI->PR = 1UL << 0;
  buttonPress = 1;
}
  
int main (void) {
// some system stuff here ...
  
  GPIO_PortClock   (GPIOD, true);
  GPIO_PinConfigure(GPIOD, 0, GPIO_MODE_INPUT, GPIO_OUTPUT_PUSH_PULL,
                    GPIO_OUTPUT_SPEED_25MHz, GPIO_PULL_UP);
// EXTI line 0
  EXTI_ConfigureLine(0, EXTI_MODE_INTERRUPT, EXTI_TRIGGER_FALLING);
// Port D
  EXTI_ConfigurePin(0, EXTI_PIN_PD);
  NVIC_EnableIRQ(EXTI0_IRQn);
  
// ... etc
}

The problem is, whatever port I have on the EXTI_ConfigurePin(), the interruption goes to port A. So the PA0 always triggers the handler, not PD0 or whatever I'm trying to use.

The functions I'm using are KEIL. I suppose they are working right, so did I forget some step, or what could it be causing the problem?

Outcomes