2009-02-05 02:59 AM
TIM2 clock
2011-05-17 04:01 AM
If the APB1 prescaler is != 1, the timer clock is multiplied by 2. Check the clock tree on page 71 of RM0008.
You should probably check what your APB1 clock speed is though. If you use the ST firmware, you can use RCC_GetClocksFreq to get this value. Mark2011-05-17 04:01 AM
Hi all,
I have problems to calculate back from timersteps to seconds. I'm using TIMER2. cpu clock is 72MHz so TIMER2 at APB1 should be f_APB1=36MHz. I would calculate the time t=(TIM_PSC x TIM_CNT)/f_APB1 i.e. PSC = 200, CNT = 13000 t=0,072s But when I measure the signal I get 0,034s. It seems that f_APB1=72MHz or somewhere else is a factor 2 ?!? Attached are pictures of the RCC and TIM2 configuration. Do you have any idea? Cheers, Michael2011-05-17 04:01 AM
Thank you Mark!
It took me 2 days more to understand it: TIM2 can be clocked with 72MHz although APB1 = 36MHz. Because of the multiplicator when the prescaler is not 1. APB1 and its following peripheral is not affected by the multiplicator. Michael