Stm32 interruptions and events

Source: Internet
Author: User

 

 

This figure is an external disconnection or external event line. There is a diagonal line on the signal line on the way, with a comment marked with 19, indicating that there are 19 sets of such lines, and the blue dotted line arrows on the way, the transmission path of the external interrupt signal is marked. First, the external signal enters from the Chip Pin of Id 1. After the edge detection circuit of ID 2, it enters the interrupt pending request register through the OR gate of number 3, finally, the module enters the Objective C interrupt controller through the gate number 4. in the upstream 4 control options of this channel, the external signal receiver passes through the edge detection circuit, this edge detection circuit is controlled by the rising or falling edge Selection Register. You can use these two registers to control which edge is needed to generate an interrupt, because the rising or falling edges are controlled by two parallel registers, you can select the rising or falling edges at the same time. If there is only one register control, you can select only one edge, the next step is the gate number 3. The "software interrupt/event register" is used for another input of this or gate. From here, we can see that the software can take precedence over the external signal to request an interrupt or event, that is, when the corresponding bit of the "software interrupt/event register" is 1, regardless of the external signal, The system outputs valid signals for the Gate 3.

After an interrupt or event request signal passes through the 3 or gate and enters the pending request register, the signal transmission paths of the interrupt and the event are consistent, that is, the pending request register records the level changes of the external signal. The external request signal finally goes through the gate number 4 and sends an interrupt request to the Objective C interrupt controller, if the corresponding bit of the interrupt shielding register is 0, the request signal cannot be transmitted to the other end of the Contact door, thus implementing the interruption shielding.

The red arrow on the way marks the transmission path of the external event signal. After the external request signal passes through the 3 or door, it enters the 5 depressed. This is similar to the door which acts on the 4, it is used to introduce the control of event shielding registers. The pulse generator converts a hop-to-hop signal to a single pulse and outputs other functions to the chip,

From this figure, we can see that there is no difference between the interrupt and the event from the external incentive signal, but it is separated within the chip. One signal will generate an interrupt request to the CPU, the other signal sends a Pulse Trigger Signal to other functional modules. The response of other functional modules is determined by the corresponding modules.

The APB bus and peripheral module interfaces at the top of the figure are part of each function module.

 

 

Summary:

Simply put, service functions must be interrupted, but the events do not have the corresponding functions. However, events can trigger other associated operations, such as triggering DMA and ADC sampling.
You can perform these operations without CPU intervention. CPU intervention is required if the operation is interrupted.

Interrupt request: When an interrupt occurs, the corresponding interrupt processing program is executed.

Event request: when an event is generated, you want to send a trigger signal to other modules. The module determines how other modules process this signal!



The source of interruptions and events can be the same!
It is divided into two parts, because the interrupt requires the CPU to participate, the interrupt service function of the software is required to complete the result after the interruption;
However, the event is the result of generating a pulse by the pulse generator, which is automatically completed by the hardware. Of course, the corresponding linkage components must be set first, such as causing DMA operations and ad ing;
A simple example: the external I/O triggers the adswitch to measure the weight of an external item;
If a traditional interrupt channel is used, I/O is required to trigger the External Interrupt. The external interrupt service program starts the adswitch, And the adswitch completes the interrupt service program to submit the final result;
If the event channel is used, I/O triggers the event, and then triggers the adswitch in association. The adswitch completes the interrupted service program and submits the final result;
In contrast, the latter should not be involved in AD trigger, and the response speed is also greater;
If you use an event to trigger the DMA Operation, you can complete some linkage tasks without the involvement of software.
In this simple way, we can think that the event mechanism provides a channel to trigger the result completely with automatic hardware. without the participation of software, the CPU load is reduced and the resource interruption is reduced, improving the response speed (hardware is always faster than software) is an effective way to improve the capability of CPU chips to process events;

Post this comment to Weibo

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.