cancel
Showing results for 
Search instead for 
Did you mean: 

(SOLVED) STM32H743ZIT6: Bad accuracy of TIM2 (32Bit Timer)

JArig.1
Associate II

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.

0693W00000aPOKxQAO.png 

Any clue about this phenomenon or hint about what I could be doing wrong?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
JArig.1
Associate II

Solved, the prescaler of the timer needs to be (240 - 1)

View solution in original post

1 REPLY 1
JArig.1
Associate II

Solved, the prescaler of the timer needs to be (240 - 1)