003-systick

smallcracker 2021-03-26 00:00:00
Categories: Tags:

stm32的Systick简介

SysTick是一个24位的系统节拍定时器system tick timer,SysTick,具有自动重载和溢出中断功能,所有基于Cortex_M3处理器的微控制器都可以由这个定时器获得一定的时间间隔。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
void SysTick_Handler(void)
{
static int i=0;
i++;
if(i==600)
{
i=0;
LED1=1-LED1;
}
}


void SYSTICK_init()
{
while(SysTick_Config(SystemCoreClock / 6000));
NVIC_SetPriority(SysTick_IRQn,0x00);
}