STM32 external interrupt register configuration analysis

Publisher:SparkStar22Latest update time:2018-07-10 Source: eefocusKeywords:stm32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The difference between events and interrupts:


As can be seen from the figure above: the trigger sources of events and interrupts are the same, both can be (external trigger edge and software interrupt register trigger)

1> When a trigger edge arrives or the software triggers the interrupt to start, the trigger signal passes through the OR gate and enters the request suspend register to suspend, and on the other hand, enters the AND gate in the figure to trigger the event pulse. If the event mask register is configured to mask the event, the pulse generator will not be started to generate a pulse signal (but the suspend bit will still be set. This is purely my own understanding. According to the data manual, it will not be suspended here). After the No. 2 route is suspended, if the interrupt register allows it, an interrupt request will be sent to the NVIC, which triggers the core action.

2> The difference between interrupts and events is that the result of an event will directly lead to the generation of an output pulse, which will trigger the corresponding hardware action. This process is automatically completed without the participation of software. Interrupts, on the other hand, require a request to the processor and enter the interrupt service function to process data, which requires the participation of software and reduces the efficiency of the CPU.


The following is a method to configure an interrupt using registers

Before that we need to understand several registers:

EXTI_IMR, EXTI_EMR, EXTI_PR, EXTI_RTSR, EXTI_ETSR, EXTI_SWIER, EXTI_PR registers

External interrupt register AFIO_EXTI[0-4];

If time output is needed, we also need the AFIO_EVCR register

The above configuration is for the peripherals. After completion, we need to perform the same configuration on the kernel. This is the end.


Keywords:stm32 Reference address:STM32 external interrupt register configuration analysis

Previous article:STM32, RTC periodic wakeup (wakeup) interrupt
Next article:stm32 Can communication filter register setting

Recommended ReadingLatest update time:2024-11-16 12:57

The role of STM32 shadow registers
This means that physically this register corresponds to two registers: one is a register that we can write or read, called the preload register, and the other is a register that we cannot see and cannot actually read or write, but is actually useful in use, called the shadow register. The data sheet states that the co
[Microcontroller]
stm32 4*4 matrix keyboard
stm32f030 development board. Use HAL library. The state machine performs debounce. col column, Pin is configured as PP push-pull output mode; row, the Pin is configured as Input mode and the internal pull-up resistor is enabled. code show as below: .h files /*  *  * Name: keypad.h  * Faq: www.mazclub.com 
[Microcontroller]
STM32 485 communication self-study summary
Prepare to summarize the 485 communication knowledge in the learning process! ---------------------------------------------------- First describe the functions you want to achieve when learning STM32 and 485 communication-------- First, complete the two-way communication in the dual-machine communication----Here A i
[Microcontroller]
STM32 485 communication self-study summary
STM32 GPIO issues
1. Question about GPIO: The IO port of STM32 is initialized as input floating, so is the pin high or low? Answer: It is neither high nor low, floating means it is not used. 2. Question about port multiplexing of stm32f103? Q: When learning GPIO, I encountered the problem of port multiplexing and I couldn't understand i
[Microcontroller]
STM32 SysTick
I feel that the 1 second timing is still a little inaccurate. It is just a visual measurement. I will use an oscilloscope to measure it next time. Included Files: (1)Main C language:  Code#14620 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Experimental platform:
[Microcontroller]
STM32 SysTick
stm32 ucos LED light delayed flashing + button flashing + serial port output
#include "main.h" #include "stdio.h" USART_InitTypeDef  USART_InitStructure; #define RCC_KEY1       RCC_APB2Periph_GPIOD #define GPIO__KEY1_Port GPIOD #define KEY1 GPIO_Pin_3 #define RCC_KEY@ RCC_APB2Periph_GPIOA #define GPIO_KEY2_Port GPIOA #define KEY2 GPIO_Pin_8 #define RCC_KEY3                                  
[Microcontroller]
STM32 DMA receives data from the serial port
Test terminal, intend to design serial port to serial port forwarding, is it feasible to use DMA in the middle? Support peripheral to peripheral? 1. If DMA is used to transmit from one serial port to another (or array), how does DMA determine whether the serial port data received is updated each time? Does DMA need to
[Microcontroller]
How do structures in STM32 organize similar registers?
#define PERIPH_BASE ((u32)0x40000000) //Port address #define APB2PERIPH_BASE (PERIPH_BASE + 0x10000) //Port address #define GPIOA_BASE (APB2PERIPH_BASE + 0x0800) //Port address #define GPIOA ((GPIO_TypeDef *) GPIOA_BASE)//     typedef unsigned long u32;  typedef volatile unsigned long vu32; // What does v
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号