cancel
Showing results for 
Search instead for 
Did you mean: 

Timer counter does not stop when it reaches the ARR value

Tommino
Senior

Hi,

I am developing a program with the nucleo STM32G474RE that passes the ARR,CCR1,CCR2 values to TIM2 after some measurements made with another general purpose timer.

However something weird occurs since when I look at TIM2 registers the ARR,CCR1,CCR2 values are correctly set but the TIM2 CNT seems to not care about the ARR value and it keeps counting.

Any idea about why this is happening?

0693W00000QKjjyQAD.png

1 ACCEPTED SOLUTION

Accepted Solutions

If you set ARR to N at the moment when CNT is already >N, CNT will count up to maximum.

This is why there's ARR preload (TIMx_CR1.ARPE).

JW

View solution in original post

3 REPLIES 3

If you set ARR to N at the moment when CNT is already >N, CNT will count up to maximum.

This is why there's ARR preload (TIMx_CR1.ARPE).

JW

Tommino
Senior

Thank jan,

So basically the ARPE bit makes the new ARR effective synchrounously with the CNT previous overflow?

Yes.

JW