STM8AF526x/8x/Ax STM8AF6269/8x/Ax
Product overview
Timer
TIM1
TIM2
TIM3
Table 6. Advanced control and general purpose timers
Counter
width
Counter
type
Prescaler
factor
Channels
Inverted Repetition
outputs counter
trigger
unit
16-bit Up/down 1 to 65536
4
3
Yes
Yes
16-bit
Up
2n
n = 0 to 15
3
None
No
No
16-bit
Up
2n
n = 0 to 15
2
None
No
No
External
trigger
Yes
No
No
Break
input
Yes
No
No
TIM1 - 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 bridge driver.
• 16-bit up, down and up/down AR (auto-reload) counter with 16-bit fractional prescaler.
• Four independent CAPCOM channels configurable as input capture, output compare,
PWM generation (edge and center aligned mode) and single pulse mode output
• Trigger module which allows the interaction of TIM1 with other on-chip peripherals. In
the present implementation it is possible to trigger the ADC upon a timer event.
• External trigger to change the timer behavior depending on external signals
• Break input to force the timer outputs into a defined state
• Three complementary outputs with adjustable dead time
• Interrupt sources: 4 x input capture/output compare, 1 x overflow/update, 1 x break
TIM2, TIM3 - 16-bit general purpose timers
• 16-bit auto-reload up-counter
• 15-bit prescaler adjustable to fixed power of two ratios 1…32768
• Timers with three or two individually configurable CAPCOM channels
• Interrupt sources: 2 or 3 x input capture/output compare, 1 x overflow/update
5.7.5
Basic timer
The typical usage of this timer (TIM4) is the generation of a clock tick.
Timer
TIM4
Table 7. TIM4
Counter
width
Counter
type
Prescaler
factor
Channels
Inverted Repetition
outputs counter
8-bit
Up
2n
n = 0 to 7
0
None
No
trigger
unit
No
External
trigger
No
Break
input
No
• 8-bit auto-reload, adjustable prescaler ratio to any power of two from 1 to 128
• Clock source: master clock
• Interrupt source: 1 x overflow/update
DocID14395 Rev 15
21/125
114