Advanced-control timers (TIM1&TIM8)
The repetition counter is decremented:
•
At each counter overflow in upcounting mode,
•
At each counter underflow in downcounting mode,
•
At each counter overflow and at each counter underflow in center-aligned mode.
Although this limits the maximum number of repetition to 128 PWM cycles, it makes it
possible to update the duty cycle twice per PWM period. When refreshing compare
registers only once per PWM period in center-aligned mode, maximum resolution is
2xT
ck
The repetition counter is an auto-reload type; the repetition rate is maintained as defined by
the TIMx_RCR register value (refer to
software (by setting the UG bit in TIMx_EGR register) or by hardware through the slave
mode controller, it occurs immediately whatever the value of the repetition counter is and the
repetition counter is reloaded with the content of the TIMx_RCR register.
In center-aligned mode, for odd values of RCR, the update event occurs either on the
overflow or on the underflow depending on when the RCR register was written and when
the counter was started. If the RCR was written before starting the counter, the UEV occurs
on the overflow. If the RCR was written after starting the counter, the UEV occurs on the
underflow. For example for RCR = 3, the UEV is generated on each 4th overflow or
underflow event depending on when RCR was written.
Figure 72. Update rate examples depending on mode and TIMx_RCR register settings
Counter
TIMx_CNT
TIMx_RCR = 0
TIMx_RCR = 1
TIMx_RCR = 2
TIMx_RCR = 3
TIMx_RCR
and
re-synchronization
305/1128
, due to the symmetry of the pattern.
Center-aligned mode
UEV
UEV
UEV
UEV
= 3
UEV
(by SW)
UEV
Update Event: Preload registers transferred to active registers and update interrupt generated
DocID13902 Rev 15
Figure
72). When the update event is generated by
Edge-aligned mode
Upcounting
(by SW)
RM0008
Downcounting
(by SW)
Need help?
Do you have a question about the STM32F101 series and is the answer not in the manual?
Questions and answers