2023-03-29 04:08 AM
Hello,
I am having accuracy issues on TIM2 (32Bit Timer). I am feeding the PLL with an HSE 32MHz crystal (which seems to be fine when I measure the MCO frequency). I have setup the Prescalers to reach a frequency of 240MHz for the APB1 Timer clocks (where the TIM2 belongs to). The thing is, after some timing measurements I get an error of 0.4% in TIM2, if I set the prescalers before the timer higher (D2PPRE1) but reduce the Prescaler within the Timer the accuracy worsens. I am a little bit puzzled, since I thought I would get something similar to the 25ppm of the HSE.
Some additional info, I have in the TIM2 a prescaler of 240 and therefore each count is equivalent to 1us.
Any clue about this phenomenon or hint about what I could be doing wrong?
Thanks
Solved! Go to Solution.
2023-03-29 04:58 AM
Solved, the prescaler of the timer needs to be (240 - 1)
2023-03-29 04:58 AM
Solved, the prescaler of the timer needs to be (240 - 1)