Advanced-control timers (TIM1/TIM8/TIM20) RM0440
1084/2126 RM0440 Rev 4
28 Advanced-control timers (TIM1/TIM8/TIM20)
28.1 TIM1/TIM8/TIM20 introduction
The advanced-control timers (TIM1/TIM8/TIM20) consist of a 16-bit auto-reload counter
driven by a programmable prescaler.
It may be used for a variety of purposes, including measuring the pulse lengths of input
signals (input capture) or generating output waveforms (output compare, PWM,
complementary PWM with dead-time insertion).
Pulse lengths and waveform periods can be modulated from a few microseconds to several
milliseconds using the timer prescaler and the RCC clock controller prescalers.
The advanced-control (TIM1/TIM8/TIM20) and general-purpose (TIMx) timers are
completely independent, and do not share any resources. They can be synchronized
together as described in Section 28.3.30: Timer synchronization.
28.2 TIM1/TIM8/TIM20 main features
TIM1/TIM8/TIM20 timer features include:
• 16-bit up, down, up/down auto-reload counter.
• 16-bit programmable prescaler allowing dividing (also “on the fly”) the counter clock
frequency either by any factor between 1 and 65536.
• Up to 6 independent channels for:
– Input capture (but channels 5 and 6)
– Output compare
– PWM generation (Edge and Center-aligned Mode)
– One-pulse mode output
• Complementary outputs with programmable dead-time
• Synchronization circuit to control the timer with external signals and to interconnect
several timers together.
• Repetition counter to update the timer registers only after a given number of cycles of
the counter.
• 2 break inputs to put the timer’s output signals in a safe user selectable configuration.
• Interrupt/DMA generation on the following events:
– Update: counter overflow/underflow, counter initialization (by software or
internal/external trigger)
– Trigger event (counter start, stop, initialization or count by internal/external trigger)
– Input capture
– Output compare
• Supports incremental (quadrature) encoder and Hall-sensor circuitry for positioning
purposes
• Trigger input for external clock or cycle-by-cycle current management