cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 GPIO external event vs interrupt.

parth kothiya
Senior

i want to execute few lines of code on both edge of input pin i know about interrupt but what is external event ?

2 REPLIES 2
S.Ma
Principal

Read the reference manual about EXTI. Examples of code are usually in the downloaded cube library, nucleo boards, EXTI project examples.

Rise and/or fall edge of signal can trigger an interrupt or a signal which can propagate to other peripherals without sw intervention.

Bob S
Principal

An interrupt can to two things: cause software to execute via an interrupt handler (if the interrupt is enabled) and cause some peripheral to do something (like triggering a timer). An event doesn't cause the interrupt handler to run, but can cause some peripheral to do something. Since you need "to execute a few lines of code" on both edges, you need to use interrupts.