cancel
Showing results for 
Search instead for 
Did you mean: 

Timer Clock division has no effect

MAI THANH.Brice
Associate III

Hi

I was reviewing my code and I wanted to change some timer configuration

So I use a STM32F727 @216MHz with all clock periph at max speed.

I use the following init (generate by cube) to configure TIM2 to get a 1 µs based timer

  htim2.Instance = TIM2;
  htim2.Init.Prescaler = 107;
  htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
  htim2.Init.Period = 0xFFFFFFFF;
  htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV2;
  htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE;

After some test, it seem's that even if I modify the clock division factor (1, 2 or 4), it doesn"t change the timing of TIM2

(After the init, the timer configuration isn't modified)

Any idea why ?

2 REPLIES 2

The name is misleading, the division in this context relates to the filter on the input sampler. ​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
MAI THANH.Brice
Associate III

It's explain a lot of things :)

I re-read the documentation and it was written, so I should have paid more attention to this small detail.

Here is the extract from the user manual, It's clear that the clock division is link to the digital filter

0690X000006C5TFQA0.png