Write it down for later use.
void SysTick_Configuration(void)
{
/* Setup SysTick Timer for 10 msec interrupts */
if (SysTick_Config(SystemCoreClock / 100)) //SysTick configuration function
{
/* Capture error */
while (1);
}
/* Configure the SysTick handler priority */
NVIC_SetPriority(SysTick_IRQn, 0x0); //SysTick interrupt priority setting
}
The key lies in the understanding of SysTick_Config(SystemCoreClock / 100)
The function is to open the counter, set the counting period, and enable interrupt. The parameter passed in is the counting period.
The cycle calculation method is: By default, the processor will call SystemInit() during initialization and set the system frequency to 72Mhz, that is, SystemCoreClock=72000000;
It can be simply understood that the system counts 72000000 times per second. If I need a 10ms timing period, I only need to set the reload number to 720000 to meet the requirement.
NVIC_SetPriority(SysTick_IRQn, 0x0); Set the priority to the highest, and adjust it according to your needs
Finally, enter the interrupt processing function
void SysTick_Handler(void)
{
}
Previous article:STM32 SysTick timer delay function
Next article:Detailed explanation of STM32 system clock settings
Recommended ReadingLatest update time:2024-11-16 15:50
- Popular Resources
- Popular amplifiers
- Automotive Electronics S32K Series Microcontrollers: Based on ARM Cortex-M4F Core
- Foundations of ARM64 Linux Debugging, Disassembling, and Reversing Analyze Code, Understand Stack Me
- The STM32 MCU drives the BMP280 absolute pressure sensor program and has been debugged
- Introduction to Artificial Intelligence and Robotics (Murphy)
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
- Ask: MOS tube switch circuit
- Introduction to the classification and manufacturing methods of PCB copper-clad laminates
- Problems that should be paid attention to in the development and design of TMS320C2XX
- Goodbye 2018, hello 2019
- STM32 related altium library files (F0, F1, F2, F3, F4, etc.)
- "Me and Intel SoC FPGA" + ARM hardcore development that is difficult to understand
- STM32L151C8T6 wake-up problem from standby mode
- A brief discussion on the causes of blistering on the copper electroplating board surface of the circuit board
- Friends who don't know how to start power supply design, please take a look at the good things shared by TI designers
- How to accurately measure switching losses?