The relationship between EXTI (external interrupt) and NVIC (nested vector interrupt) in STM32

Publisher:心灵舞动Latest update time:2015-11-11 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
NVIC is part of the Cortex-M3 core. Information about it is not in the "STM32 Technical Reference Manual". You should refer to ARM's "Cortex-M3 Technical Reference Manual"

The vector interrupts of Cortex-M3 are uniformly managed by NVIC.
EXTI is the external interrupt control extended by ST on its STM32 products. It is responsible for managing the external interrupts mapped to the GPIO pins and the interrupts of several integrated peripherals on the chip (PVD, RTC alarm, USB wakeup, ethernet wakeup), as well as software interrupts. Its output is eventually mapped to the corresponding channel of NVIC. Therefore, the process of configuring EXTI interrupts must include the configuration of NVIC. For example, the process of configuring EXTI0 below first configures the EXTI controller (enables the corresponding interrupt line, selects the interrupt/event mode, and triggers the edge polarity), and then configures the NVIC controller (the channel number of EXTI0 mapped on NVIC, interrupt priority, and interrupt masking status):


GPIO_EXTILineConfig(GPIO_PortSourceGPIOB, GPIO_PinSource0);


EXTI_InitStructure.EXTI_Line = EXTI_Line0;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;  // or Rising
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);


NVIC_InitStructure.NVIC_IRQChannel = EXTI0_IRQn; // EXTI0_IRQn is defined in stm32f10x.h
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);

The value of EXTI0_IRQn is actually the position of the EXTI0 interrupt vector in the interrupt vector table (the value in the Position column of the interrupt vector table in the STM32 Technical Reference Manual)

Keywords:STM32 Reference address:The relationship between EXTI (external interrupt) and NVIC (nested vector interrupt) in STM32

Previous article:STM32 clock tree notes
Next article:S3C2410 NorFlash expansion

Recommended ReadingLatest update time:2024-11-16 21:47

Showcasing 15 years of innovation achievements with STM32 ecosystem partners
Showcasing 15 years of innovation achievements with STM32 ecosystem partners 2022 STM32 China Online Technology Week focuses on industry and energy, artificial intelligence and smart travel, smart Internet of Things, information security and functional safety, ecology and innovation During
[Embedded]
A visual explanation of nvic in stm32
I saw an explanation about stm32 nvic, which used the concepts of class and stratum. It was very vivid and easy to understand. Link: http://blog.sina.com.cn/s/blog_5f17618501012rpp.html NVIC——Nested Vectored Interrupt Controller STM32 has 43 channel settable interrupt sources: AIRC (Application Interrupt and Reset Reg
[Microcontroller]
STM32RTC real-time clock
I use the STM32 library function: Two knowledge points:       1. RTC clock block diagram analysis (important)       2. How is the time displayed (brief analysis) 1. RTC clock block diagram analysis (important) First, let's get familiar with a few knowledge points:       1. The real-time clock (RTC) of STM32 is an inde
[Microcontroller]
STM32RTC real-time clock
STM32 Learning Road - LCD (3)
The function is copied from the example of struggle, which can be regarded as some notes. However, the annotations of the example of struggle are not very detailed. Today I went to the forum of Zhengdian Atom, and I felt that Zhengdian Atom did a really good job. All the information is open source, and most of the que
[Microcontroller]
STM32 study notes (serial port, IAP)
Serial Port:   一. USART_ITConfig(USART1, USART_IT_TXE, ENABLE): As long as the transmit register is empty, there will always be an interrupt. Therefore, if you are not sending data, turn off the transmit interrupt and turn it on only when you start sending.   two. The following is the configuration process for charact
[Microcontroller]
Detailed explanation of STM32 water temperature control system hardware
System introduction: Water temperature control system based on STM32F103. Realize water temperature control in any range from room temperature to 100 degrees. Accuracy: +/-1 degree Celsius. Average response time: 5 minutes. Control object: 1 kg of water. The main components of the system are: platinum temperature meas
[Microcontroller]
STM32 study notes - serial port interrupt receiving indefinite data buff
Today, let's talk about how to receive indefinite length byte data on the STM32 microcontroller. Since the STM32 microcontroller has an IDLE interrupt, this interrupt can be used to receive indefinite length byte data. Since the STM32 microcontroller belongs to an ARM microcontroller, the method in this article is als
[Microcontroller]
STM32 study notes - serial port interrupt receiving indefinite data buff
Design of sensor interface module based on STM32
Abstract: Based on STM32, the current type, voltage type and digital IO type sensor interface modules are implemented; the software design of the interface module is carried out, and the detailed firmware code design is explained. In addition to the traditional serial port, an Ethernet interface is provided, and t
[Industrial Control]
Design of sensor interface module based on STM32
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号