STM32 interrupt concept and understanding

Publisher:紫菜包饭Latest update time:2018-12-01 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. STM32 reduces the register bits for specifying interrupt priority to 4 bits. The grouping of these 4 register bits is as follows:


Group 0: All 4 bits are used to specify the response priority


Group 1: The highest bit is used to specify the preemptive priority, and the lowest 3 bits are used to specify the response priority


Group 2: The highest 2 bits are used to specify the preemptive priority, and the lowest 2 bits are used to specify the response priority


Group 3: The highest 3 bits are used to specify the preemptive priority, and the lowest 1 bit is used to specify the response priority


Group 4: All 4 bits are used to specify preemptive priority



//Set up NVIC


//NVIC_PreemptionPriority: preemption priority


//NVIC_SubPriority: response priority


//NVIC_Channel: interrupt number


//NVIC_Group: interrupt group 0~4


//Note that the priority cannot exceed the range of the set group! Otherwise, there will be unexpected errors


2. Priority


1. A high-priority preemption priority can interrupt an ongoing low-priority preemption interrupt. 


2. Preempt interrupts with the same priority level. Interrupts with higher priority levels cannot interrupt interrupts with lower priority levels. 


3. Preempt interrupts with the same priority. When two interrupts occur at the same time, the one with higher response priority will be executed first. 


4. If the preemption priority and response priority of two interrupts are the same, the interrupt that occurs first will be executed first.



Keywords:STM32 Reference address:STM32 interrupt concept and understanding

Previous article:EFM32 chip internal and external devices--MSC does not turn off the total interrupt
Next article:Strange problem of STM32 not being able to delay after calling SysTick_Config

Latest Microcontroller Articles
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号