This figure is a schematic diagram of an external interrupt line or external event line. There is a slash on the signal line in the figure, and the annotation marked with the word 19 next to it indicates that there are 19 sets of such lines. The blue dotted arrow in the figure marks the transmission path of the external interrupt signal. First, the external signal enters from the chip pin numbered 1, passes through the edge detection circuit numbered 2, enters the interrupt suspension request register through the OR gate numbered 3, and finally outputs to the NVIC interrupt detection circuit through the AND gate numbered 4. This edge detection circuit is controlled by the rising edge or falling edge selection register. The user can use these two registers to control which edge is required to generate an interrupt. Because the selection of the rising edge or falling edge is controlled by two parallel registers respectively, the user can select the rising edge or the falling edge at the same time. If there is only one register control, then only one edge can be selected.
Next is the OR gate numbered 3. The other input of this OR gate is the software interrupt/event register. From this, we can see that the software can request an interrupt or event before the external signal. That is, when the corresponding bit of the software interrupt/event register is "1", the OR gate numbered 3 will output a valid signal regardless of the external signal.
An interrupt or event request signal passes through the OR gate number 3 and enters the suspend request register. Before this, the signal transmission paths of interrupts and events are consistent, that is, the level changes of external signals are recorded in the suspend request register.
The external request signal finally passes through the AND gate No. 4 and sends an interrupt request to the NVIC interrupt controller. If the corresponding bit of the interrupt mask register is "0", the request signal cannot be transmitted to the other end of the AND gate, thus realizing the interrupt masking.
After understanding the request mechanism of external interrupts, it is easy to understand the request mechanism of events. The red dotted arrow in the figure marks the transmission path of the external event signal. After the external request signal passes through the OR gate numbered 3, it enters the AND gate numbered 5. The function of this AND gate is similar to that of the AND gate numbered 4, which is used to introduce the control of the event mask register; finally, a jump signal of the pulse generator is converted into a single pulse and output to other functional modules in the chip. From this figure, we can also know that from the perspective of external excitation signals, the sources of interrupts and events can be the same. The reason why it is divided into two parts is that interrupts require the participation of the CPU, and the software's interrupt service function is required to complete the results generated after the interrupt; but events rely on the pulse generator to generate a pulse , and then the hardware automatically completes the result of this event. Of course, the corresponding linkage components need to be set up first, such as causing DMA operation, AD conversion, etc.;
a simple example: external I/O triggers AD conversion to measure the weight of external objects; if the traditional interrupt channel is used, I/O triggers to generate an external interrupt, the external interrupt service program starts AD conversion, and the interrupt service program submits the final result after the AD conversion is completed; if the event channel is used, the I/O trigger generates an event, and then the linkage triggers AD conversion, and the interrupt service program submits the final result after the AD conversion is completed; in comparison, the latter does not require software to participate in AD triggering, and the response speed is also faster; if the event is used to trigger the DMA operation, some linkage tasks can be completed without software participation.
Summarize:
It can be simply considered that the event mechanism provides a channel from triggering to generating results that is completely completed by hardware automatically, without the involvement of software, reducing the CPU load, saving interrupt resources, and improving the response speed (hardware is always faster than software). It is an effective way to use hardware to improve the CPU chip's ability to handle events;
Previous article:STM32 register operation mode learning - GPIO
Next article:STM32 register operation mode learning-clock configuration
Recommended ReadingLatest update time:2024-11-16 09:30
- Popular Resources
- Popular amplifiers
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
- How to understand these four statements in STM32F103RCT6? The return statement should be declared before the main function, right?
- MSP430 JTAG interface and BSW interface
- NXP launches new MCX series, high performance with NPU, to replace LPC and Kinetis?
- Chapter 5: Reading DHT12 data
- Share the disassembly of IPP-5002
- [Raspberry Pi Pico Review] --- Getting Started
- Problems of overcurrent and overvoltage protection in voltage doubler rectifier circuit
- When installing 32-bit dependent libraries in 64-bit Ubuntu, "libc6:i386 (!= 2.19-0ubuntu6.6) but 2.19...
- Popular science information on the entire process of chip design and production
- [Rivet RVB2601 Creative Application Development] 1. Routine Experience - Music Player