STM32 timers
The timers in STM32 microcontrollers are classified into two main categories: general-purpose timers and advanced timers.
Introduction to general-purpose timers and advanced timers
General-purpose timers are highly versatile and can be used for a variety of applications, whereas advanced timers offer more sophisticated features than general-purpose timers, making them suitable for high-precision and complex timing tasks.
In the STM32F411 microcontroller, timers TIM2, TIM3, TIM4, TIM5, TIM9, TIM10, and TIM11 are general-purpose timers, whereas TIM1 is an advanced timer.
Key features of the general-purpose timers include the following:
- Counter size: They feature 16-bit counters for TIM3 and TIM4 and 32-bit counters for TIM2 and TIM5, capable of operating in up, down, or up/down auto-reload modes
- Prescaler: They are equipped with a 16-bit programmable prescaler, which allows us to divide the counter-clock frequency by any factor ranging from 1 to 65...