
RM0008
Advanced-control timers (TIM1&TIM8)
Doc ID 13902 Rev 12
293/1096
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
, due to the symmetry of the pattern.
The repetition counter is an auto-reload type; the repetition rate is maintained as defined by
the TIMx_RCR register value (refer to
). When the update event is generated by
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.
Figure 72.
Update rate examples depending on mode and TIMx_RCR register
settings
Center-aligned mode
Edge-aligned mode
UEV
Update Event
: Preload registers transferred to active registers and update interrupt generated
Counter
TIMx_RCR = 0
TIMx_RCR = 1
TIMx_RCR = 2
TIMx_RCR = 3
Update Event
if the repetition counter underflow occurs when the counter is equal to
to the auto-reload value.
UEV
TIMx_RCR
= 3
and
re-synchronization
(by SW)
(by SW)
TIMx_CNT
(by SW)
Upcounting
Downcounting
UEV
UEV
UEV
UEV