Skip to main content
MAI THANH.Brice
Associate III
September 26, 2018
Question

Timer Clock division has no effect

  • September 26, 2018
  • 2 replies
  • 1155 views

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 ?

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
September 26, 2018

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 VenmoUp vote any posts that you find helpful, it shows what's working..
MAI THANH.Brice
Associate III
September 26, 2018

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