Introduction: Isn't the interrupt of 51 MCU just jumping to another place when something happens in the middle, and returning after execution? Why do we need to use interrupts specifically? Can't we just jump to the instruction directly?
First of all, to understand the interrupt, we must first talk about the pins of the microcontroller P3 port; P30 to P35 are the input pins of the interrupt. Including serial ports, timers (counters), external interrupts, etc. The characteristics of these interrupts are that when the interrupt conditions are met, the corresponding interrupt program will be executed. Note that there is an important difference between the execution of the interrupt program and the subroutine of the assembly language: (most textbooks do not mention this point) The subroutine must have a call statement such as ACALL to call it before it can be executed; but the interrupt is not! It is automatically executed after the interrupt condition is met. For example: the timer counts full; the external interrupt pin is triggered at a low level; the serial port receives data..., at this time the program automatically jumps to the interrupt entry: 03H, 0BH, .... 23H. After entering the interrupt entry, it is generally necessary to jump and then jump to the corresponding interrupt subroutine (unless your interrupt program is very short and will not enter other interrupts). Take C language as an example, in C51, the interrupt function does not need to be called by the main function main(), and is automatically executed (provided that the condition that triggers the interrupt occurs).
Isn't interruption just jumping to another place when something happens in the middle and returning after execution?
The "what happens in the middle" here refers to the interrupt that is triggered. According to the type of interrupt that is triggered, the program automatically jumps to the entry program (for example, if external interrupt 0 is triggered, it jumps to 03H, and if serial port interrupt is triggered, it jumps to 23H. These entry addresses are generally arranged with jump instructions)
Why do we need to use interrupts specifically? Can't we just jump to the instruction directly?
The microcontroller works in this way of interruption! For example, when the microcontroller is processing data, an external device sends a signal to start. This is an external interrupt signal. After receiving it, the microcontroller enters the corresponding interrupt program to start the device, or monitor the device, etc. Without interruption, the function of the microcontroller is greatly reduced. Does it mean that one is a known conditional jump and the other is unknown, so the interruption is used. This is the meaning, but it is not accurate. The interrupt is caused by an external signal, or the clock timing is reached, or the serial data is received. In short, the generation of the interrupt is not determined by the code in the program.
Previous article:X25045 reading and writing program written by c51
Next article:About C51 memory types and physical areas of 51 microcontrollers
Recommended ReadingLatest update time:2024-11-16 16:20
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Regarding the number of bits of the microcontroller, the number of bits of the ADC, and the number of bits of the PWM, ADC and PWM are both indicators that reflect the resolution...
- Please teach me an op amp circuit - RMS to DC circuit
- 【Silicon Labs Development Kit Review】+ PWM Example Test
- Porter-3: Will this topology work?
- Problem with the abs function
- Xunwei i.MX6ULL development board-Transplant OpenCv2.4.9-QT program compilation
- [Me and Arteli] DIY an AT32 board, full of favorability
- Microcontroller selection
- Made a tool to use serial port IAP to realize batch online upgrade program
- Things that electronic hardware engineers need to know