Download Print this page

ST STM32F301 6 Series Reference Manual page 578

Advanced arm-based 32-bit mcus

Advertisement

Basic timers (TIM6)
20.3.2
Counting mode
The counter counts from 0 to the auto-reload value (contents of the TIMx_ARR register),
then restarts from 0 and generates a counter overflow event.
An update event can be generate at each counter overflow or by setting the UG bit in the
TIMx_EGR register (by software or by using the slave mode controller).
The UEV event can be disabled by software by setting the UDIS bit in the TIMx_CR1
register. This avoids updating the shadow registers while writing new values into the preload
registers. In this way, no update event occurs until the UDIS bit has been cleared, however,
the counter and the prescaler counter both restart from 0 (but the prescale rate does not
change). In addition, if the URS (update request selection) bit in the TIMx_CR1 register is
set, setting the UG bit generates an update event UEV, but the UIF flag is not set (so no
interrupt or DMA request is sent).
When an update event occurs, all the registers are updated and the update flag (UIF bit in
the TIMx_SR register) is set (depending on the URS bit):
The buffer of the prescaler is reloaded with the preload value (contents of the
TIMx_PSC register)
The auto-reload shadow register is updated with the preload value (TIMx_ARR)
The following figures show some examples of the counter behavior for different clock
frequencies when TIMx_ARR = 0x36.
Timerclock = CK_CNT
Counter register
Counter overflow
Update event (UEV)
Update interrupt flag
578/874
Figure 234. Counter timing diagram, internal clock divided by 1
CK_PSC
CNT_EN
31
(UIF)
RM0366 Rev 5
32
33
34 35 36
00
01
02
03
06
04
05
RM0366
07
MS31078V2

Advertisement

loading
Need help?

Need help?

Do you have a question about the STM32F301 6 Series and is the answer not in the manual?

This manual is also suitable for:

Stm32f301 8 seriesStm32f318 8 series