Interrupt Priority of MCS-51 Series Microcontrollers

Publisher:RadiantExplorerLatest update time:2016-09-21 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
In the default state, the interrupt priority control register IP is 0, and all interrupt sources are at low priority. When all interrupt sources are at the same priority and request interrupts from the CPU at the same time, the CPU responds in order of priority; the conditions for interrupt nesting are: the interrupt source that the CPU responds to first should be at a low priority, and when the CPU executes the interrupt service program of the interrupt source, another interrupt source with a higher priority requests an interrupt. Interrupt sources with the same priority cannot achieve interrupt nesting. That is, interrupt nesting means being interrupted again during the interrupt service process! The so-called priority is strictly a queuing mechanism, and there is no nesting between them.

1. If multiple interrupts occur at the same time, the interrupt with higher priority will be  
executed first. 2. If multiple interrupts occur at the same time  
, the interrupt with higher priority will be executed first. 3. When a low-priority interrupt is being executed, a high-priority interrupt can interrupt the low-priority interrupt program 
. 4. When a low-priority interrupt is being executed, a high-priority interrupt with higher priority cannot interrupt the low-priority interrupt program.

This question is like when you go to the hospital to see a doctor, there are general registration, emergency number, and special rescue number (such as Comrade Xiao Hu was assassinated).

Now there is only one doctor in the hospital. Normally, the doctor diagnoses the patients with ordinary registration in sequence. When there is an emergency patient, the doctor stops diagnosing the ordinary patients and goes to diagnose the emergency patient. When the emergency patient is operating, a special rescue patient comes. The doctor immediately stops rescuing the emergency patient and rushes to rescue the special rescue patient. After rescuing the special rescue patient, the doctor returns to the emergency patient's operating room and continues to operate on him. After completing the emergency patient's operation, the doctor returns to his office to diagnose the ordinary patients.

The level of registration is different, and the doctor's treatment is also different. In the end, there are too few doctors in the hospital. One doctor can only see one patient at a time. The single-core era is like this hospital. There is only one person who can do things, and all things have to wait in line.

Reference address:Interrupt Priority of MCS-51 Series Microcontrollers

Previous article:C language program using DS18B20 temperature sensor in single chip microcomputer (reference 1)
Next article:51 MCU-IO port control

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号