2018-06-06 04:42 AM
Hi!
I found setting up an external interrupt in an STM32F103 to be a little bit hard. What is the sequence of to do's? I can find information fragments about the EXTI and NVIC, scattered through the reference manual and programming manual, while all I need is a few lines of hint what to do. Can somebody explain how to do it? I am not using any HAL, only CMSIS.
#external-interrupt #stm32-exti #nvic2018-06-06 05:39 AM
SYSCFG-> EXTICR [2] = SYSCFG_EXTICR3_EXTI11_PD;
EXTI-> RTSR | = EXTI_RTSR_TR11; // up front EXTI-> FTSR | = EXTI_FTSR_TR11; // the front on recession EXTI-> IMR | = EXTI_IMR_MR11; // set an interrupt mask sNVIC_EnableIRQ (EXTI15_10_IRQn, 14); // enable interrupts EXTI11This is one of the simplest peripheral nodes in the chip. It works exactly as described in the documentation.
The interrupt is reset by writing a unit, the operator '| =' is not required !!!
2018-06-06 07:08 AM
You can find this information in ST site in application notes section.
2018-06-06 10:42 AM
Thank you!
I completely forgot about these materials. But at the first glance on these resources, I haven't found anything on interrupts. I'll go over them more carefully later.
2018-06-06 03:38 PM
Avi's post appears to contain the complete guide (after setting clocks and perhaps not setting GPIOs as Analog), except that the EXTI mux on the slightly ancient 'F1xx is in AFIO (which also needs to enable clock) rather than SYSCFG.
JW
2018-06-08 07:06 AM
Yep it works, and very easy once you know how it works and what to do. But when you do it the firs time, it's not as obvious and the EXTI mux is indeed in AFIO registers in th F1xx series. Thanks! .