Timer Overview
Timers are perhaps the most versatile piece of hardware in any micro. As their name tells, timers are
useful for measurement of timed events like frequency, time, phase sequence, etc. and generate
time-based events like PWM, waveform, etc.
Timers are also needed for touch sensing applications.
In any STM8 micro, there are three categories of timers. These are:
• Advanced Control Timer (TIM1)
• General Purpose Timers (TIM2, TIM3 & TIM5)
• Basic Timers (TIM4 & TIM6)
The basic working principle of all timers are same with some minor differences. Advanced timers are
mainly intended for applications requiring specialized motor control, SMPSs, inverters, waveform
generation, pulse width measurements, etc. Then there are general purpose timers that share almost
all the features of advanced timer without the advanced features like brake, dead-time control, etc.
Basic timers are all same as general purpose timers but lack PWM output/capture input pins and are
intended mainly for time base generations. Here’s the summary of all timers of STM8 micros:
Unlike the timers of other micros, STM8 timers have the more functionality that are otherwise only
available in some special micros only. Timer cover a significant part of the reference manual. They are
so elaborate that it is not possible to describe all of them in just one post. Therefore, here we’ll be
exploring the basics for now.