当前位置:网站首页>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 (2) - switch circuit design
- Shape template matching based on Halcon learning [viii] PM_ multiple_ models. Hdev routine
- [trio basic tutorial 16 from introduction to proficiency] UDP communication test supplement
- Carrier period, electrical speed, carrier period variation
- 【云原生 | 从零开始学Kubernetes】三、Kubernetes集群管理工具kubectl
- Extern keyword function
- Adaptive filter
- Nb-iot technical summary
- QEMU STM32 vscode debugging environment configuration
- Verilog -- state machine coding method
猜你喜欢

C language enhancement -- pointer

Brief discussion on Buck buck circuit

Detailed summary of FIO test hard disk performance parameters and examples (with source code)

Negative pressure generation of buck-boost circuit

【云原生 | 从零开始学Kubernetes】三、Kubernetes集群管理工具kubectl
![C WinForm [view status bar -- statusstrip] - Practice 2](/img/40/63065e6c4dc4e9fcb3e898981f518a.jpg)
C WinForm [view status bar -- statusstrip] - Practice 2

Summary of SIM card circuit knowledge

Management and use of DokuWiki (supplementary)
![[trio basic tutorial 18 from introduction to proficiency] trio motion controller UDP fast exchange data communication](/img/05/0f63e4cd3da24e5b956ec5899b939d.jpg)
[trio basic tutorial 18 from introduction to proficiency] trio motion controller UDP fast exchange data communication

Development tools -- gcc compiler usage
随机推荐
Summary of SIM card circuit knowledge
Anonymous structure in C language
Sizeof (function name) =?
Slist of linked list
Management and use of DokuWiki (supplementary)
QEMU STM32 vscode debugging environment configuration
STM32 tutorial triple ADC interleaved sampling
Why is 1900 not a leap year
Hardware 1 -- relationship between gain and magnification
NTC thermistor application - temperature measurement
C WinForm [get file path -- traverse folder pictures] - practical exercise 6
UE像素流,来颗“减肥药”吧!
Soem EtherCAT source code analysis II (list of known configuration information)
Basic embedded concepts
Measurement fitting based on Halcon learning [III] PM_ measure_ board. Hdev routine
Problem solving: interpreter error: no file or directory
Improve lighting C program
Synchronization of QT multithreading
Fundamentals of C language
[trio basic tutorial 16 from introduction to proficiency] UDP communication test supplement