Datasheet

STM8L052R8 Functional overview
Doc ID 023133 Rev 2 15/55
Figure 2. High density value line STM8L05xxx clock tree diagram
1. The HSE clock source can be either an external crystal/ceramic resonator or an external source (HSE
bypass). Refer to Section HSE clock in the STM8L15x and STM8L16x reference manual (RM0031).
2. The LSE clock source can be either an external crystal/ceramic resonator or a external source (LSE
bypass). Refer to Section LSE clock in the STM8L15x and STM8L16x reference manual (RM0031).
3.5 Low power real-time clock
The real-time clock (RTC) is an independent binary coded decimal (BCD) timer/counter.
Six byte locations contain the second, minute, hour (12/24 hour), week day, date, month,
year, in BCD (binary coded decimal) format. Correction for 28, 29 (leap year), 30, and 31
day months are made automatically.The subsecond field can also be read in binary format.
The calendar can be corrected from 1 to 32767 RTC clock pulses. This allows to make a
synchronization to a master clock.
The RTC offers a digital calibration which allows an accuracy of +/-0.5ppm.
It provides a programmable alarm and programmable periodic interrupts with wakeup from
Halt capability.
Periodic wakeup time using the 32.768 kHz LSE with the lowest resolution (of 61 µs) is
from min. 122 µs to max. 3.9 s. With a different resolution, the wakeup time can reach
36 hours.
Periodic alarms based on the calendar can also be generated from every second to
every year.
A clock security system detects a failure on LSE, and can provide an interrupt with wakeup
capability. The RTC clock can automatically switch to LSI in case of LSE failure.
The RTC also provides 3 anti-tamper detection pins. This detection embeds aprogrammable
filter and can wakeup the MCU.
(3%/3#
 -(Z
(3)2#
 -(Z
,3)2#
K (Z
,3%/3#
 K
(
Z
(3)
,3)
24#
PRESCALER

0#,+
TOPERIPHERALS
24##,+
TO,#$
TO)7$'
393#,+
(3%
,3)
,3%
/3#?/54
/3#?/54
/3#?).
/3#?).
CLOCKOUTPUT
##/
PRESCALER

(3)
,3)
(3%
,3%
##/
TOCOREAND
MEMORY
393#,+
0RESCALER

)7$'#,+
24#3%,;=
,3%
#,+"%%03%,;=
TO"%%0
"%%0#,+
-36
#33
CONFIGURABLE

0ERIPHERAL
#LOCKENABLEBITS
TO24#
24##,+
CLOCKENABLEBIT
,#$#,+
TO,#$
393#,+
(ALT
CLOCKENABLEBIT
,#$PERIPHERAL
24##,+
,#$PERIPHERAL
#33?,3%