Datasheet

DocID15962 Rev 13 21/131
STM8L151xx, STM8L152xx Functional overview
56
Reliable touch sensing solutions can be quickly and easily implemented using the free
STM8 Touch Sensing Library.
3.14 Timers
Medium density STM8L15x devices contain one advanced control timer (TIM1), two 16-bit
general purpose timers (TIM2 and TIM3) and one 8-bit basic timer (TIM4).
All the timers can be served by DMA1.
Table 3 compares the features of the advanced control, general-purpose and basic timers.
3.14.1 TIM1 - 16-bit advanced control timer
This is a high-end timer designed for a wide range of control applications. With its
complementary outputs, dead-time control and center-aligned PWM capability, the field of
applications is extended to motor control, lighting and half-bridge driver.
16-bit up, down and up/down autoreload counter with 16-bit prescaler
3 independent capture/compare channels (CAPCOM) configurable as input capture,
output compare, PWM generation (edge and center aligned mode) and single pulse
mode output
1 additional capture/compare channel which is not connected to an external I/O
Synchronization module to control the timer with external signals
Break input to force timer outputs into a defined state
3 complementary outputs with adjustable dead time
Encoder mode
Interrupt capability on various events (capture, compare, overflow, break, trigger)
Table 3. Timer feature comparison
Timer
Counter
resolution
Counter
type
Prescaler factor
DMA1
request
generation
Capture/compare
channels
Complementary
outputs
TIM1
16-bit up/down
Any integer
from 1 to 65536
Yes
3 + 1 3
TIM2
Any power of 2
from 1 to 128
2
None
TIM3
TIM4 8-bit up
Any power of 2
from 1 to 32768
0