AnsweredAssumed Answered

TIM clock

Question asked by goyer.yohann on Oct 31, 2014
Latest reply on Oct 31, 2014 by Clive One
Hello,
I want to make a timer for my software (call a call back when time is finish).
I need to understand the clock source for the timer.
I choose to work with TIM7 for that (basic timer).
As I see, using RCC_GetClocksFreq(&Clock_Info_s), I have some clock on my system.:
 SYSCLK_Frequency 168000000 
 HCLK_Frequency 168000000 
 PCLK1_Frequency 42000000 
 PCLK2_Frequency 84000000 

What is the clock source to be used to calculate the prescaler and period for my timer?
By experience I found that the source clock shall be 82.6MHz. The nearest is PCLK2 @84MHz, but with 2% error!!

How can I configure my period and prescaler to have a good accuracy (<0.5%)?

Outcomes