RM0401 Rev 3 341/771
RM0401 General-purpose timers (TIM5)
389
Figure 97. General-purpose timer block diagram
15.3 TIM5 functional description
15.3.1 Time-base unit
The main block of the programmable timer is a 32-bit counter with its related auto-reload
register. The counter can count up. The counter clock can be divided by a prescaler.
The counter, the auto-reload register and the prescaler register can be written or read by
software. This is true even when the counter is running.
The time-base unit includes:
• Counter Register (TIMx_CNT)
• Prescaler Register (TIMx_PSC):
• Auto-Reload Register (TIMx_ARR)
The auto-reload register is preloaded. Writing to or reading from the auto-reload register
accesses the preload register. The content of the preload register are transferred into the
shadow register permanently or at each update event (UEV), depending on the auto-reload
preload enable bit (ARPE) in TIMx_CR1 register. The update event is sent when the counter
reaches the overflow (or underflow when downcounting) and if the UDIS bit equals 0 in the
TIMx_CR1 register. It can also be generated by software. The generation of the update
event is described in detail for each configuration.
ƵƚŽ ƌĞůŽĂĚ ƌĞŐ ŝƐ ƚĞƌ
ĂƉƚƵ ƌĞĐŽŵ ƉĂƌĞ ϭ ƌĞŐ ŝƐ ƚĞƌ
ĂƉƚƵ ƌĞĐŽŵ ƉĂƌĞ Ϯ ƌĞŐ ŝƐ ƚĞƌ
h
h
h
ϭ /
Ϯ/
dƌŝŐŐĞƌ
ĐŽŶ ƚƌŽůůĞƌ
^ ƚŽƉ Đ ůĞĂ ƌ Žƌ ƵƉĚŽǁŶ
d/ϭ&W ϭ
d/Ϯ&W Ϯ
/d Z Ϭ
/d Z ϭ
/d Z Ϯ
/d Z ϯ
dZ' /
ŶĐŽĚĞ ƌ
/ŶƚĞƌĨĂ Đ Ğ
ĂƉƚƵƌĞĐŽŵƉĂƌĞ ϯ ƌĞŐŝƐƚĞƌ
h
ϯ/
ŽƵƚƉƵƚ
ĐŽŶ ƚƌŽů
Kϭ
dZ'K
K ϭZ &
KϮZ &
Kϯ Z &
h
h/
ĂƉ ƚƵƌĞĐŽŵ ƉĂƌĞ ϰ ƌĞŐ ŝƐƚĞƌ
h
ϰ /
KϰZ &
W ƌĞƐĐĂ ůĞƌ
WƌĞƐĐĂ ůĞƌ
/ ϰW ^
/ ϯW ^
/ ϭ
/ Ϯ
W ƌĞƐĐĂ ůĞƌ
W ƌĞƐĐĂ ůĞƌ
/ŶƉƵ ƚ ĨŝůƚĞƌ Θ
ĞĚŐĞ ĚĞƚĞĐƚŽƌ
/ ϮW ^
/ ϭW ^
d/ϭ&Wϭ
KϮ
Kϯ
Kϰ
ZĞŐ
ĞǀĞŶƚ
EŽƚĞƐ
W ƌĞ ůŽ Ă ĚƌĞŐŝƐ ƚĞƌƐ ƚƌĂ ŶƐ ĨĞƌƌĞ Ě
ƚŽ Ă Đ ƚŝǀĞ ƌĞŐŝƐ ƚĞƌƐ ŽŶ h Ğǀ ĞŶƚ
ĂĐĐŽƌĚŝŶŐ ƚŽ ĐŽŶƚƌŽů ďŝƚ
ŝŶƚĞƌƌƵƉƚΘ D Ž ƵƚƉƵƚ
d'/
dZ
dZ
/ ϯ
/ ϰ
/d Z
dZ
d/ϭ&ͺ
/ŶƉƵ ƚ ĨŝůƚĞƌ Θ
ĞĚŐĞ ĚĞƚĞĐƚŽƌ
/ŶƉƵ ƚ ĨŝůƚĞƌ Θ
ĞĚŐĞ ĚĞƚĞĐƚŽƌ
/ŶƉƵ ƚ ĨŝůƚĞƌ Θ
ĞĚŐĞ ĚĞƚĞĐƚŽƌ
ϭ /
Ϯ/
ϯ/
ϰ/
d/ϭ&WϮ
d/Ϯ&Wϭ
d/Ϯ&WϮ
d/ϯ&Wϯ
dZ
dZ
d/ϯ&Wϰ
d/ϰ&Wϯ
d/ϰ&Wϰ
d/ϰ
d/ϯ
d/ϭ
d/Ϯ
yKZ
d/Ddžͺ,ϭ
d /Ddžͺ ,
d /Ddžͺ ,
d /Ddžͺ ,
d /Ddžͺ ,
ƚŽ ŽƚŚĞƌ ƚŝŵĞƌƐ
W ƌĞƐĐĂůĞ ƌ Đ ŽƵŶƚĞ ƌ
нͲ
<ͺW^
W^
E d
<ͺEd
ĐŽŶ ƚƌŽůůĞƌ
ŵŽĚĞ
^ůĂǀĞ
dZ &
ƚŽ
ŽƵƚƉƵƚ
ĐŽŶ ƚƌŽů
ŽƵƚƉƵƚ
ĐŽŶ ƚƌŽů
ŽƵƚƉƵƚ
ĐŽŶ ƚƌŽů
06Y9
d/Ddžͺ,Ϯ
d/Ddžͺ,ϯ
d/Ddžͺ,ϰ
d/Ddžͺ><ĨƌŽŵZ
/ŶƚĞƌŶĂůůŽĐŬ;<ͺ/EdͿ
5HDGHQDEOHXS
FRXQW