General-purpose timer (TIMx) RM0008
274/690
13.2 TIMx main features
General purpose TIMx (TIM2, TIM3, TIM4 and TIM5) 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 65535.
● Up to 4 independent channels for:
– Input capture
– Output compare
– PWM generation (Edge and Center-aligned mode)
– One-pulse mode output
● Synchronization circuit to control the timer with external signals and to interconnect
several timers between them.
● 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 cicuitry for positioning
purposes
● Trigger intput for external clock or cycle-by-cycle current management