Uses TIM1
.
Tricks
- Using bypass clock at 8MHz coming from ST-Link board
- Configuring the correct
Prescaler
andPeriod
values; They are off-by-1. - TIM1 is on APB2, which is set to 216MHz
- PSC is 21600 and ARR is 10000, giving an interrupt every ~1s
- Useful stm32 timer formulas
- Remember to start the timer
HAL_TIM_PeriodElapsedCallback
is called just by naming convention afterCubeMX
NVIC
configuration