AnsweredAssumed Answered

STM32F407 Timer Frequency

Question asked by AlexSmart on Mar 9, 2015
Latest reply on Mar 10, 2015 by AlexSmart
I can't understand how come TIM1 frequency is 42 MHz.
Here is my config:
12 MHz HSE -> 168 MHz PLLCLK (MCO/4 = 42 MHz, checked)
APB1 prescaler = 4
APB2 prescaler = 2
so TIM1, as it clocked from APB2 x 2 frequency should be 168 MHz.
But output (GPIO^PIN in update interrupt) generates 0.21 MHz frequency
0.21x100x2 = 42MHz.

RCC_PCLK1Config(RCC_HCLK_Div4);
RCC_PCLK2Config(RCC_HCLK_Div2);
RCC_HCLKConfig(RCC_SYSCLK_Div1);

TIM_TimeBaseStructure.TIM_Period                         = 99;
TIM_TimeBaseStructure.TIM_Prescaler                     = 0;
TIM_TimeBaseStructure.TIM_ClockDivision                 = TIM_CKD_DIV1;
TIM_TimeBaseStructure.TIM_CounterMode                     = TIM_CounterMode_Up;
TIM_TimeBaseInit(TIM1, &TIM_TimeBaseStructure);

Outcomes