SysTick 시간기기(timer) 편 강의 입니다.
전체 보기 : https://makershackers.tistory.com/tag/baremetal_stm32_f411
template_002_makershackers_systick_wo_movie.pptx
9.17MB
전체 보기 : https://makershackers.tistory.com/tag/baremetal_stm32_f411
tick
① 째깍거리다, 똑딱거리다
② 똑딱거리는 소리, 재깍거리는 소리
timing
① 시기 선택, 속도를 맞추는, 적절한 시기를 찾아내는 기술, 시간을 잘 맞춤
② 박자, 박자 감각
time
어떤 시각에서 어떤 시각까지의 사이
#include "stm32f4xx.h"
void delay_milliseconds_using_system_tick(int mills);
int main (void)
{
(*RCC).AHB1ENR |= 1;
(*GPIOA).MODER |= 0x400;
while(1)
{
delay_milliseconds_using_system_tick(2000);
(*GPIOA).ODR ^= 0x20;
}
}
void delay_milliseconds_using_system_tick(int mills)
{
(*SysTick).LOAD = 16000-1; // Reload with number of clocks per millisecond
(*SysTick).VAL = 0; // Clear current value register
(*SysTick).CTRL = 0x5; // System Tick을 사용함
for (int i =0; i<mills;i++)
{
// wait until the count flag is set
while((SysTick->CTRL & 0x10000)==0){}
}
SysTick -> CTRL = 0;
}
'hardwares > stm32' 카테고리의 다른 글
STM32F103 스터디 모임 (8일/8일) (0) | 2022.01.03 |
---|---|
SysTick 시간기기(timer) (1/2) (0) | 2021.07.15 |
Nucleo-F411RE 내장 LED 깜빡이기 - BSRR (0) | 2021.03.11 |
[ 번역 ] MOOC - STM32Cube.AI workshop (2/2) (0) | 2021.02.18 |
[ 번역 ] MOOC - STM32Cube.AI workshop (1/2) (0) | 2021.02.18 |