System Tick Timer

The STM32F429ZI offers a 24 bit system tick timer. It is a simple down counter.
The system tick timer counts down from the reload value to zero and generates an interrupt.







ENABLE0Systick timer disabled (reset state)
1Systick timer enabled
TICKINT0Systick interrupt disabled (reset state)
1Systick interrupt enabled
CLKSRC0Systick clock ⇒ fHCLK / 8 (reset state)
1Systick clock ⇒ fHCLK




* Reload value of SysTick timer.




* Current value of SysTick timer.

#include "reg_stm32f4xx.h"
 
STK->CTRL = (0x3 << 1u);             /* Set clock and interrupt. */
STK->LOAD = 84000u;                  /* Set reload value: 84 MHz / 84000 -> 1 ms. */
STK->CTRL |= (0x1 << 0u);            /* Enable timer. */
 
void SysTick_Handler(void)
{
    /* Handler for SysTick interrupt. */
}


  • stm32/peripherals/systick.txt
  • Last modified: 2022/12/27 17:53
  • by ruan