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.
ENABLE | 0 | Systick timer disabled (reset state) |
1 | Systick timer enabled | |
TICKINT | 0 | Systick interrupt disabled (reset state) |
1 | Systick interrupt enabled | |
CLKSRC | 0 | Systick clock ⇒ fHCLK / 8 (reset state) |
1 | Systick clock ⇒ fHCLK |
#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. */ }