2022-07-08 01:36 AM
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?
Solved! Go to Solution.
2022-07-08 02:19 AM
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
2022-07-08 02:19 AM
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
2022-07-08 03:01 AM
Thank jan,
So basically the ARPE bit makes the new ARR effective synchrounously with the CNT previous overflow?
2022-07-08 03:57 AM
Yes.
JW