External falling edge interrupt: SETB IT0. The hardware automatically samples the pin in each machine cycle. If the level changes from high to low in two consecutive cycles, it is considered that there is an interrupt request, and IE0 = 1. IE0 will remain until the interrupt request is responded to by the CPU. It will not be automatically cleared before the response. Only after the response will the hardware automatically clear IE0 to IE0 = 0.
External low-level interrupt: CLR IT0. When the interrupt pin is at a low level and maintains a machine cycle, the hardware automatically sets IE0=1. If the interrupt pin is sampled at a high level in the next cycle, the hardware automatically clears IE0 to 0. Conditions for automatically clearing the interrupt flag: The falling edge interrupt will only be cleared to 0 when the CPU responds to the interrupt, otherwise it will remain. Low-level interrupt: At any time when the external interrupt pin is at a low level, IE0=1; when it is at a high level, IE0=0, so there is no need to respond to the interrupt to clear it to 0, which is related to the pin status. Note: When EA=0, the interrupt pin is at a low level and IE0 will not be automatically set to 1. It will only be automatically set to 1 when EA=1.
When there are two CPUs in the single-chip design, the main CPU should pay attention to the following when controlling the interrupt of the sub-CPU: when the main CPU sends an interrupt signal, the sub-CPU can receive it in time, that is, the sub-CPU working state is not allowed to run in the program with CLR EA disabled. As long as the sub-CPU is not working in the program with interrupt disabled, the sub-CPU can respond to the interrupt signal sent by the main CPU in time. In addition, if the falling edge method is used, the interval between the high and low levels sent by the main CPU only needs one NOP instruction. Therefore, this time difference problem should be considered as much as possible. Sometimes, the main CPU sends an interrupt signal before the sub-CPU has finished running the program that masks the interrupt, causing the sub-CPU to be unable to interrupt or to work intermittently.
Keyboard interrupts can finally come to an end today.
Now I know that having a program structure does not mean that the program is easy to complete. More time is spent on debugging, simulation, debugging again, and so on. So when you encounter problems, you must be patient, confident, and careful. If you do these three things, you will succeed! ! ! !
Previous article:Design of Small Temperature Detection System Based on Matlab
Next article:51 single chip microcomputer read and write max186 c51 program
Recommended ReadingLatest update time:2024-11-16 13:28
- Popular Resources
- Popular amplifiers
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Fundamentals and Applications of Single Chip Microcomputers (Edited by Zhang Liguang and Chen Zhongxiao)
- Single chip microcomputer control technology (Li Shuping, Wang Yan, Zhu Yu, Zhang Xiaoyun)
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
- Will the reset pin of the microcontroller be invalid?
- Received the X-NUCLEO-IKS01A3 sensor kit
- 【Mil MYD-YA15XC-T】- 0: How to power on?
- Xilinx Zynq-7015 SoC Industrial Core Board SOM-XQ7Z15 Cortex-A9 + Artix-7
- ADI Power Supply Expert Training Course Advanced Edition is in progress! What are you waiting for?
- ARM Architecture and Programming
- Gigabit RISC-V GD32VF103USB CDC debugging
- Problems encountered in debugging the Southchip SC8721 high-efficiency synchronous buck-boost converter
- (A-Current signal detection device) Chongqing "TI Cup" Award_Chongqing University of Posts and Telecommunications
- This appears and I can't choose it. It's grayed out.