Skip to main content
SS.Sagar
Associate III
September 16, 2016
Question

external interrupt is not generating on PB0 pin

  • September 16, 2016
  • 1 reply
  • 583 views
Posted on September 16, 2016 at 20:17

hi,

i m trying to set the external interrupt for PB0 pin on rising or falling edge. i configured but it is not working properly.

here is configuration i gave

[CODE]

&sharpdefine NVIC_PRIORITY_MASK(prio) ((prio) << (8U - (unsigned)__NVIC_PRIO_BITS))

void set_exti(void)

{

  RCC->APB2ENR |= 0x00000001;

  SYSCFG->EXTICR[0] = 0x00000001;

  EXTI->RTSR = 0x00000001;

  nvicEnableVector(EXTI0_IRQn,0);

  NVIC_EnableIRQ(EXTI0_IRQn);

}

void nvicEnableVector(uint32_t n, uint32_t prio) {

  NVIC->IP[n] = NVIC_PRIORITY_MASK(prio);

  NVIC->ICPR[n >> 5U] = 1U << (n & 0x1FU);

  NVIC->ISER[n >> 5U] = 1U << (n & 0x1FU);

}

[/CODE]

i am changing the voltage level on pin then also it is not extecuting isr_routine.

please help me with generating external interrupt.

#nucleo #stm32 #exti #eclipse
This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
September 16, 2016
Posted on September 16, 2016 at 20:52

On what STM32 part?

If you can't get your own register level code functioning, then try the SPL code, and work back from there.

If using .CPP make sure the IRQ Handler name isn't mangled, and that you have correctly linkage through the Vector Table.

Use the ''Format Code Block'' (Paintbrush [< >] icon) to post source, and remember to post enough for it to be self standing and compilable. Disconnected fragments of code don't provide enough context to know if they describe where the actual problem lays.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..