当前位置:网站首页>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);
边栏推荐
- Negative pressure generation of buck-boost circuit
- VESC Benjamin test motor parameters
- Semiconductor devices (III) FET
- Soem EtherCAT source code analysis II (list of known configuration information)
- Management and use of DokuWiki (supplementary)
- Basic embedded concepts
- 1-stm32 operation environment construction
- UEFI development learning 2 - running ovmf in QEMU
- Some thoughts on extracting perspectives from ealfa and Ebeta
- Hardware 3 -- function of voltage follower
猜你喜欢
Embedded composition and route
Some thoughts on extracting perspectives from ealfa and Ebeta
How to select conductive slip ring
PMSM dead time compensation
Keil use details -- magic wand
H264 (I) i/p/b frame gop/idr/ and other parameters
Wifi-802.11 negotiation rate table
STM32 virtualization environment of QEMU
C WinForm [change the position of the form after running] - Practical Exercise 4
Compilation warning solution sorting in Quartus II
随机推荐
Sql Server的存储过程详解
STM32 tutorial triple ADC interleaved sampling
LED display equipment records of the opening ceremony of the Beijing Winter Olympics
Soem EtherCAT source code analysis I (data type definition)
Interview catalogue
Circleq of linked list
[cloud native | learn kubernetes from scratch] III. kubernetes cluster management tool kubectl
Briefly talk about the identification protocol of mobile port -bc1.2
2021-10-28
Network port usage
Bootloader implementation of PIC MCU
List of linked lists
Charge pump boost principle - this article will give you a simple understanding
C WinForm [display real-time time in the status bar] - practical exercise 1
UE像素流,来颗“减肥药”吧!
General makefile (I) single C language compilation template
Class of color image processing based on Halcon learning_ ndim_ norm. hdev
What are the test items of power battery ul2580
Shape template matching based on Halcon learning [v] find_ cocoa_ packages_ max_ deformation. Hdev routine
UEFI development learning 3 - create UEFI program