2016-09-16 11:17 AM
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 #eclipse2016-09-16 11:52 AM
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.