Electronic – What does ClockDivision do, as opposed to the Prescaler for STM32 timers

stm32timer

I am using an STM32 board (F7 series), and am looking through the HAL API documentation. When I initialize a timer, I see two values, Prescaler and ClockDivision. Now I understand that the Prescaler is used to divide the frequency of the clock. However, what is the ClockDivision supposed to do? I see it has three possible values, DIV1, DIV2, and DIV4.

My auto-generated code says the following.

enter image description here

enter image description here

Best Answer

With a big assumption that everything below holds true or at least be similar to F7 series description. I could be completely wrong! Please double check!

According to the stm32 F4 family datasheet register description, the "ClockDivision" stands for

CKD: This bit-field indicates the division ratio between the timer clock (CK_INT) frequency and the dead-time and sampling clock (tDTS)used by the dead-time generators and the digital filters (ETR, TIx),

00: tDTS=tCK_INT

01: tDTS=2*tCK_INT

10: tDTS=4*tCK_INT

11: Reserved, do not program this value

I could not find any specific documentation related to F7 series and I am not quite aware of dead-time generators usage but ETR stands for "External Trigger Input".

Beware TIM1 is a special Timer, the same description do not hold true for other general pupose timers(ex. TIM2 etc.)

Also, HAL API Documentation is particularly not useful as it is just an accumulation of all the HAL Library comments without any description. If you are still interested, this might be helpful for you.