Visitor II
January 7, 2019
Question
Sistick has wrong period
- January 7, 2019
- 1 reply
- 905 views
In HAL_Init(); generated by STMCubeMX
/* Compute TIM1 clock */
uwTimclock = 2*HAL_RCC_GetPCLK2Freq();
is set to 32000000 instead of 216000000
/* Compute the prescaler value to have TIM1 counter clock equal to 1MHz */
uwPrescalerValue = (uint32_t) ((uwTimclock / 1000000) - 1);
prescaler is wrong, 31 instead of 215
What is wrong ?