EXTI has two functions: one is to generate an interrupt, the purpose is to pass the input signal to NVIC, further run the interrupt service function, realize the function, at the software level; the other is to generate an event, the purpose is to generate a pulse signal for other peripherals to use, this is the circuit level signal transmission, at the hardware level. EXTI is mounted on the APB2 bus. EXTI0 to EXTI15 are used for GPIO, and EXTI16-EXTI22 are used for specific peripheral interrupt/event lines.
1. Initialize the GPIO that needs to be interrupted
2. Initialize EXTI to generate interrupts/events
Enable SYSCFG clock. To use GPIO external interrupt, you must enable SYSCFG clock.
Connect the EXTI interrupt source to the GPIO
Initialize the EXTI structure
1.EXTI interrupt/event line selection, EXTI_Line:EXTI_Line0 -EXTI_Line22 selection, but in the STM32 library function there is also External interrupt line 23 Connected to the LPTIM Wakeup event.
2.EXTI_Mode mode selection, choose to generate interrupt or generate event
3.EXTI_Trigger, select rising edge trigger or falling edge trigger
4.EXTI_LineCmd, whether to enable the EXTI line
Select EXTI interrupt source
3. Configure NVIC
Configuring NVIC Priority Groups
Configuring interrupt sources
Configuring preemption priority
Configure the priority of grabbing children
Enable interrupt channel
4. Write interrupt service function
Previous article:STM32 Learning IIC
Next article:STM32 learning DMAM-M mode
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Let’s talk about the “Three Musketeers” of radar in autonomous driving
- Why software-defined vehicles transform cars from tools into living spaces
- How Lucid is overtaking Tesla with smaller motors
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- LTC2325-16 Sampling Issues
- Design considerations for single-chip microcomputer key scanning program
- How to change the library file in the schematic diagram in orcad?
- Free application: Domestic FPGA Gaoyunjia Little Bee Family GW1N Series Development Board
- Taking stock of the college entrance examination experience of Internet tycoons! How many points did you get in the exam?
- Without American EDA software, we can’t make chips?
- 【Share】Flash management tools: FAL (Flash Abstraction Layer) library
- [Awards awarded] Grab the post! Download the TWS headset white paper, write a wonderful review, and win a JD card!
- Constant voltage circuit and constant current circuit composed of operational amplifier and triode
- [RVB2601 Creative Application Development] Record the startup process of the hello world system