What is an interrupt? It means interrupting what you are currently doing and moving on to something else. The microcontroller interrupt means that when the microcontroller is executing the program, suddenly a button is pressed (generating an external interrupt), and the microcontroller must process that button (interrupt response) to see what happened. After the button is processed Continue to return to program execution (interrupted return).
Structure of MCS-51 microcontroller interrupt system
The symbols, names and conditions of generation of the five interrupt sources are as follows.
INT0: External interrupt 0, introduced by the P3.2 port line, caused by low level or falling edge.
INT1: External interrupt 1, introduced by the P3.3 port line, caused by low level or falling edge.
T0: Timer/Counter 0 interrupt, caused by T0 overflowing and returning to zero.
T1: Timer/counter l interrupt, caused by T1 full return to zero.
TI/RI: Serial I/O interrupt, caused after the serial port completes the transmission/reception of a frame of characters.
The structural block diagram of the entire interrupt system is shown in Figure 1 below.
Figure 1 51 microcontroller interrupt system structure
As shown in the figure, it consists of special function registers related to interrupts, interrupt entrances, sequence query logic circuits, etc., including 5 interrupt request sources, and 4 interrupt control registers IE, IP, ECON and SCON to control interrupt types. Turn on and off interrupts and determine the priority of various interrupt sources.
Interrupt request source
(1) External interrupt request source: external interrupts 0 and 1, which are introduced through external pins. There are two pins on the microcontroller named INT0 and INT1, which are the two tubes P3.2 and P3.3. foot. There are four bits in the internal TCON related to external interrupts. IT0: INT0 trigger mode control bit, which can be set and reset by software. IT0=0, INT0 is a low-level trigger mode, IT0=1, INT0 is a negative transition trigger mode. The differences between these two methods will be discussed later. IE0: INT0 interrupt request flag bit. When there is an external interrupt request, this bit will be set to 1 (this is done by hardware). After the CPU responds to the interrupt, the hardware will clear IE0 to 0. The uses of IT1 and IE1 are the same as IT0 and IE0.
(2) Internal interrupt request source TF0: the overflow interrupt flag of timer T0. When T0 counts overflow, TF0 is set by hardware. When the CPU responds to the interrupt, TF0 is cleared to 0 by hardware. TF1: Similar to TF0. TI, RI: Serial port transmission and reception interrupts, which will be explained later in the serial port.
Interrupt enable register IE In the MCS-51 interrupt system, the enable or disable of interrupts is controlled by the on-chip bit-addressable 8-bit interrupt enable register IE. where EA is the master switch, if it is equal to 0, all interrupts are not allowed. ES - serial port interrupt enable ET1 - timer 1 interrupt enable EX1 - external interrupt 1 interrupt enable. ET0 - Timer 0 interrupt enabled EX0 - External interrupt 0 interrupt enabled. If we want to allow external interrupt 1, timer 1 interrupt is allowed, and others are not allowed, then IE can be EAX or 8CH. Of course, we can also use bit operation instructions
SETBEA
SETBET1SETBEX1
Previous article:Time error analysis of 8051 microcontroller timer overflow interrupt and CPU response interrupt
Next article:Extended interrupt method of 51 microcontroller
- 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 application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- EEWORLD University - Designing wide input DC/DC converters for solar inverter applications
- UCC28056 PFC Evaluation Board
- In low temperature environment, the battery level of the device is displayed as 90%, but when it is brought to normal temperature, the battery level drops rapidly until it shuts down. What is the principle behind this?
- Qorvo launches payload products into space to commemorate its 5th anniversary, speaking with strength!
- Temperature measurement in the electronics and semiconductor industries
- Working principle and structure analysis of variable frequency series resonance
- EEWORLD University ---- Linux driver strategy and framework
- Phase shifter classification and working principle (Part 1)
- [TI recommended course] #Live replay: Application of TI millimeter wave sensors in smart home#
- EEWORLD University ---- Live playback: The most important component of the analog world - Signal chain and power supply: Amplifier special