当前位置:网站首页>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);
边栏推荐
- Classic application of MOS transistor circuit design (1) -iic bidirectional level shift
- Fundamentals of C language
- Arduino uses nrf24l01+ communication
- 亿学学堂给的证券账户安不安全?哪里可以开户
- General makefile (I) single C language compilation template
- Brief discussion on Buck buck circuit
- Take you to understand the working principle of lithium battery protection board
- Drive LED -- GPIO control
- go依赖注入--google开源库wire
- Sql Server的存储过程详解
猜你喜欢
Drive LED -- GPIO control
Halcon's practice based on shape template matching [1]
Talk about the function of magnetic beads in circuits
Connection mode - bridge and net
[trio basic tutorial 16 from introduction to proficiency] UDP communication test supplement
Interview catalogue
DokuWiki deployment notes
Briefly talk about the identification protocol of mobile port -bc1.2
Shape template matching based on Halcon learning [vi] find_ mirror_ dies. Hdev routine
Volatile of C language
随机推荐
Process communication mode between different hosts -- socket
Network communication process
Management and use of DokuWiki
Network communication model -- Network OSI tcp/ip layering
C#,数值计算(Numerical Recipes in C#),线性代数方程的求解,LU分解(LU Decomposition)源程序
Halcon's practice based on shape template matching [2]
My-basic application 1: introduction to my-basic parser
Create inf module in AMI code
Improve lighting C program
Sql Server的存儲過程詳解
Adaptive filter
Measurement fitting based on Halcon learning [III] PM_ measure_ board. Hdev routine
DokuWiki deployment notes
Imx6ull bare metal development learning 1-assembly lit LED
Measurement fitting based on Halcon learning [II] meaure_ pin. Hdev routine
DCDC circuit - function of bootstrap capacitor
Live555 push RTSP audio and video stream summary (III) flower screen problem caused by pushing H264 real-time stream
Fundamentals of C language
OC and OD gate circuit
Take you to understand the working principle of lithium battery protection board