当前位置:网站首页>Stm32--- systick timer
Stm32--- systick timer
2022-07-05 08:15:00 【chen_ bx】
STM32---Systick Timer
brief introduction
Systick Timer , It's a simple timer , about CM3,CM4 Kernel chip , There are Systick Timer .
Systick Timers are often used to delay , Or the heartbeat clock of the real-time system . This can save MCU resources , Don't waste a timer . such as UCOS in , Time division multiplexing , Need a minimum timestamp , Generally in STM32+UCOS In the system , All use Systick do UCOS Heartbeat clock .
Systick The timer is the system tick timer , One 24 Bit countdown timer , Count 0 when , Will be taken from RELOAD The initial value of the automatic reload timing in the register . As long as you don't put it in SysTick Enable bits in the control and status registers are cleared , Never stop , Works even in sleep mode .
SysTick The timer is tied to NVIC in , Used to produce SYSTICK abnormal ( Exception number :15).
Systick The priority of interrupts can also be set .
working principle
The system timer triggers 1KHz The interrupt , Interrupt cycle time
T= 1/f =1000ms/1000=1ms
The system timer is connected to PLL Output 72MHz The clock
As long as the system timer 72000000 Times count , Namely 1 The arrival of seconds
As long as the system timer 72000 Times count , Namely 1ms The arrival of time
As long as the system timer 72 Times count , Namely 1us The arrival of time
SysTick_Config(SystemCoreClock/1000);
Systick register
CTRL -> SysTick Control and status registers
LOAD -> SysTick Auto reload division register
VAL -> SysTick Current value register
CALIB -> SysTick Calibration value register
SysTick Control and status registers - CTRL
about STM32, The external clock source is HCLK(AHB Bus clock ) Of 1/8 The kernel clock is HCLK The clock
Configuration function :SysTick_CLKSourceConfig();
SysTick Reload the load value register - LOAD
SysTick Current value register - VAL
In the firmware library Systick Correlation function
SysTick_CLKSourceConfig() //Systick Clock source selection misc.c In file
SysTick_Config(uint32_t ticks) // initialization systick, The clock is HCLK, And turn on the interrupt
//core_cm3.h/core_cm4.h In file
Systick Interrupt service function :
void SysTick_Handler(void);
边栏推荐
- Naming rules for FreeRTOS
- OLED 0.96 inch test
- Verilog -- state machine coding method
- Explain task scheduling based on Cortex-M3 in detail (Part 2)
- Several important parameters of LDO circuit design and type selection
- PMSM dead time compensation
- NTC thermistor application - temperature measurement
- Programming knowledge -- assembly knowledge
- 【论文阅读】2022年最新迁移学习综述笔注(Transferability in Deep Learning: A Survey)
- C language enhancement -- pointer
猜你喜欢
Explain task scheduling based on Cortex-M3 in detail (Part 2)
Summary of SIM card circuit knowledge
Summary -st2.0 Hall angle estimation
C WinForm [change the position of the form after running] - Practical Exercise 4
How to copy formatted notepad++ text?
Altium designer learning (I)
Makefile application
Improve lighting C program
Development tools -- gcc compiler usage
Some thoughts on extracting perspectives from ealfa and Ebeta
随机推荐
DCDC circuit - function of bootstrap capacitor
[tutorial 15 of trio basic from introduction to proficiency] trio free serial communication
C language # and #
Slist of linked list
Altium designer learning (I)
Classic application of MOS transistor circuit design (2) - switch circuit design
Summary -st2.0 Hall angle estimation
Classic application of MOS transistor circuit design (1) -iic bidirectional level shift
Talk about the function of magnetic beads in circuits
Compilation warning solution sorting in Quartus II
UEFI development learning 5 - simple use of protocol
Synchronization of QT multithreading
C WinForm [help interface - send email] - practice five
Bluetooth hc-05 pairing process and precautions
Live555 push RTSP audio and video stream summary (I) cross compilation
OLED 0.96 inch test
Imx6ull bare metal development learning 1-assembly lit LED
Semiconductor devices (I) PN junction
Summary of SIM card circuit knowledge
Management and use of DokuWiki (supplementary)