8x peripheral communication interfaces
–1x USB 2.0 crystal-less, battery charging
detection and LPM
–2x USART (ISO 7816, IrDA), 1x UART (low
power)
–Up to 4x SPI 16 Mbits/s
–2x I2C (SMBus/PMBus)
•
9x timers: 1x 16-bit with up to 4 channels, 2x 16-bit
with up to 2 channels, 1x 16-bit ultra-low-power
timer, 1x SysTick, 1x RTC, 1x 16-bit basic for DAC,
and 2x watchdogs (independent/window)
1.8 V to 3.6 V (down to 1.65 V at power-down) with BOR option
1.65 V to 3.6 V without BOR option
12/150DS10182 Rev 9
1
1
141724
(3)
STM32L052x6 STM32L052x8Description
Table 2. Ultra-low-power STM32L052x6/x8 device features and peripheral counts (continued)
Peripheral
STM32L0
52T6
STM32
L052K6
STM32
L052C6
STM32
L052R6
STM32L
052T8
STM32
L052K8
STM32
L052C8
STM32
L052R8
Operating temperatures
Packages
1. 2 SPI interfaces are USARTs operating in SPI master mode.
2. LQFP32 has two GPIOs, less than UFQFPN32 (27).
3. TFBGA64 has one GPIO, one ADC input and one capacitive sensing channel less than LQFP64.
WLCSP
36
LQFP32,
UFQFPN
32
Ambient temperature: –40 to +125 °C
Junction temperature: –40 to +130 °C
LQFP48
UFQFPN
48
LQFP64
TFBGA
64
WLCSP
36
LQFP32,
UFQFPN
32
LQFP48
UFQFPN
48
LQFP64
TFBGA
64
DS10182 Rev 913/150
37
DescriptionSTM32L052x6 STM32L052x8
CORTEX M0+ CPU
Fmax:32MHz
SWD
MPU
NVIC
GPIO PORT A
GPIO PORT B
GPIO PORT C
GPIO PORT D
GPIO PORT H
Temp
sensor
RESET & CLK
FLASH
EEPROM
BOOT
RAM
DMA1
AHB: Fmax 32MHz
TSC
CRC
RNG
BRIDGE
A
P
B
2
FIREWALL
DBG
EXTI
ADC1
SPI1
USART1
TIM21
COMP1
LSE
TIM22
BRIDGE
A
P
B
1
CRS
TIM6
RAM 1K
DAC1
I2C1
I2C2
USART2
USB 2.0 FS
LPUART1
SPI2/I2S
TIM2
IWDG
RTC
WWDG
LPTIM1
BCKP REG
HSEHSI 16M
PLL
MSI
LSI
HSI 48M
PMU
REGULATOR
VDD
VDDA
VREF_OUT
NRST
PVD_IN
OSC32_IN,
OSC32_OUT
OSC_IN,
OSC_OUT
WKUPx
PA[0:15]
PH[0:1]
PD[2]
PC[0:15]
PB[0:15]
AINx
MISO, MOSI,
SCK, NSS
RX, TX, RTS,
CTS, CK
2ch
2ch
INP, INM, OUT
IN1, IN2,
ETR, OUT
DP, DM, OE,
CRS_SYNC,
VDD_USB
OUT1
SCL, SDA,
SMBA
SCL, SDA,
SMBA
RX, TX, RTS,
CTS, CK
RX, TX, RTS,
CTS
MISO/MCK,
MOSI/SD,
SCK/CK, NSS/
WS
4ch
SWD
MS3388V1
COMP2
INP, INM, OUT
Figure 1. STM32L052x6/8 block diagram
14/150DS10182 Rev 9
STM32L052x6 STM32L052x8Description
2.2 Ultra-low-power device continuum
The ultra-low-power family offers a large choice of core and features, from 8-bit proprietary
core up to Arm
®
Cortex®-M4, including Arm® Cortex®-M3 and Arm® Cortex®-M0+. The
STM32Lx series are the best choice to answer your needs in terms of ultra-low-power
features. The STM32 ultra-low-power series are the best solution for applications such as
gaz/water meter, keyboard/mouse or fitness and healthcare application. Several built-in
features like LCD drivers, dual-bank memory, low-power run mode, operational amplifiers,
128-bit AES, DAC, crystal-less USB and many other definitely help you building a highly
cost optimized application by reducing BOM cost. STMicroelectronics, as a reliable and
long-term manufacturer, ensures as much as possible pin-to-pin compatibility between all
STM8Lx and STM32Lx on one hand, and between all STM32Lx and STM32Fx on the other
hand. Thanks to this unprecedented scalability, your legacy application can be upgraded to
respond to the latest market feature and efficiency requirements.
DS10182 Rev 915/150
37
Functional overviewSTM32L052x6 STM32L052x8
3 Functional overview
3.1 Low-power modes
The ultra-low-power STM32L052x6/8 support dynamic voltage scaling to optimize its power
consumption in Run mode. The voltage from the internal low-drop regulator that supplies
the logic can be adjusted according to the system’s maximum operating frequency and the
external voltage supply.
There are three power consumption ranges:
•Range 1 (V
•Range 2 (full V
•Range 3 (full V
Seven low-power modes are provided to achieve the best compromise between low-power
consumption, short startup time and available wakeup sources:
•Sleepmode
In Sleep mode, only the CPU is stopped. All peripherals continue to operate and can
wake up the CPU when an interrupt/event occurs. Sleep mode power consumption at
16 MHz is about 1 mA with all peripherals off.
•Low-power run mode
This mode is achieved with the multispeed internal (MSI) RC oscillator set to the lowspeed clock (max 131 kHz), execution from SRAM or Flash memory, and internal
regulator in low-power mode to minimize the regulator's operating current. In Lowpower run mode, the clock frequency and the number of enabled peripherals are both
limited.
•Low-power sleepmode
This mode is achieved by entering Sleep mode with the internal voltage regulator in
low-power mode to minimize the regulator’s operating current. In Low-power sleep
mode, both the clock frequency and the number of enabled peripherals are limited; a
typical example would be to have a timer running at 32 kHz.
When wakeup is triggered by an event or an interrupt, the system reverts to the Run
mode with the regulator on.
Stopmode with RTC
The Stop mode achieves the lowest power consumption while retaining the RAM and
register contents and real time clock. All clocks in the V
PLL, MSI RC, HSE crystal and HSI RC oscillators are disabled. The LSE or LSI is still
running. The voltage regulator is in the low-power mode.
Some peripherals featuring wakeup capability can enable the HSI RC during Stop
mode to detect their wakeup condition.
The device can be woken up from Stop mode by any of the EXTI line, in 3.5 µs, the
processor can serve the interrupt or resume the code. The EXTI line source can be any
GPIO. It can be the PVD output, the comparator 1 event or comparator 2 event
(if internal reference voltage is on), it can be the RTC alarm/tamper/timestamp/wakeup
events, the USB/USART/I2C/LPUART/LPTIMER wakeup events.
range limited to 1.71-3.6 V), with the CPU running at up to 32 MHz
DD
range), with a maximum CPU frequency of 16 MHz
DD
range), with a maximum CPU frequency limited to 4.2 MHz
DD
domain are stopped, the
CORE
16/150DS10182 Rev 9
STM32L052x6 STM32L052x8Functional overview
•Stop mode without RTC
The Stop mode achieves the lowest power consumption while retaining the RAM and
register contents. All clocks are stopped, the PLL, MSI RC, HSI and LSI RC, HSE and
LSE crystal oscillators are disabled.
Some peripherals featuring wakeup capability can enable the HSI RC during Stop
mode to detect their wakeup condition.
The voltage regulator is in the low-power mode. The device can be woken up from Stop
mode by any of the EXTI line, in 3.5 µs, the processor can serve the interrupt or
resume the code. The EXTI line source can be any GPIO. It can be the PVD output, the
comparator 1 event or comparator 2 event (if internal reference voltage is on). It can
also be wakened by the USB/USART/I2C/LPUART/LPTIMER wakeup events.
•Standby mode with RTC
The Standby mode is used to achieve the lowest power consumption and real time
clock. The internal voltage regulator is switched off so that the entire V
CORE
domain is
powered off. The PLL, MSI RC, HSE crystal and HSI RC oscillators are also switched
off. The LSE or LSI is still running. After entering Standby mode, the RAM and register
contents are lost except for registers in the Standby circuitry (wakeup logic, IWDG,
RTC, LSI, LSE Crystal 32 KHz oscillator, RCC_CSR register).
The device exits Standby mode in 60 µs when an external reset (NRST pin), an IWDG
reset, a rising edge on one of the three WKUP pins, RTC alarm (Alarm A or Alarm B),
RTC tamper event, RTC timestamp event or RTC Wakeup event occurs.
•Standby mode without RTC
The Standby mode is used to achieve the lowest power consumption. The internal
voltage regulator is switched off so that the entire V
domain is powered off. The
CORE
PLL, MSI RC, HSI and LSI RC, HSE and LSE crystal oscillators are also switched off.
After entering Standby mode, the RAM and register contents are lost except for
registers in the Standby circuitry (wakeup logic, IWDG, RTC, LSI, LSE Crystal 32 KHz
oscillator, RCC_CSR register).
The device exits Standby mode in 60 µs when an external reset (NRST pin) or a rising
edge on one of the three WKUP pin occurs.
Note:The RTC, the IWDG, and the corresponding clock sources are not stopped automatically by
entering Stop or Standby mode.
DS10182 Rev 917/150
37
Functional overviewSTM32L052x6 STM32L052x8
Table 3. Functionalities depending on the operating power supply range
Functionalities depending on the operating power supply
range
Operating power supply
range
(1)
DAC and ADC
operation
Dynamic voltage
scaling range
USB
V
= 1.65 to 1.71 V
DD
= 1.71 to 1.8 V
V
DD
VDD = 1.8 to 2.0 V
(2)
(2)
VDD = 2.0 to 2.4 V
VDD = 2.4 to 3.6 V
1. GPIO speed depends on VDD voltage range. Refer to Table 61: I/O AC characteristics for more information
about I/O speed.
2. CPU frequency changes from initial to final must respect "fcpu initial <4*fcpu final". It must also respect 5
μs delay between two changes. For example to switch from 4.2 MHz to 32 MHz, you can switch from 4.2
MHz to 16 MHz, wait 5 μs, then switch from 16 MHz to 32 MHz.
3. To be USB compliant from the I/O voltage standpoint, the minimum V
Table 4. CPU frequency range depending on dynamic voltage scaling
ADC only, conversion
time up to 570 ksps
ADC only, conversion
time up to 1.14 Msps
Conversion time up to
1.14 Msps
Conversion time up to
1.14 Msps
Conversion time up to
1.14 Msps
Range 2 or
range 3
Range 1, range 2 or
range 3
Range1, range 2 or
range 3
Range 1, range 2 or
range 3
Range 1, range 2 or
range 3
is 3.0 V.
DD_USB
Not functional
Functional
Functional
Functional
Functional
(3)
(3)
(3)
(3)
CPU frequency rangeDynamic voltage scaling range
16 MHz to 32 MHz (1ws)
32 kHz to 16 MHz (0ws)
8 MHz to 16 MHz (1ws)
32 kHz to 8 MHz (0ws)
Range 1
Range 2
32 kHz to 4.2 MHz (0ws)Range 3
18/150DS10182 Rev 9
STM32L052x6 STM32L052x8Functional overview
IPsRun/ActiveSleep
Table 5. Functionalities depending on the working mode
(from Run/active down to standby)
Low-
power
run
power
Low-
sleep
(1)
StopStandby
Wakeup
capability
CPUY--Y------
Flash memoryOOOO----
RAMYYYYY--
Backup registersYYYYYY
EEPROMOOOO----
Brown-out reset
(BOR)
OOOOOOOO
DMAOOOO----
Programmable
Voltage Detector
OOOOOO-
(PVD)
Power-on/down
reset (POR/PDR)
High Speed
Internal (HSI)
High Speed
External (HSE)
Low Speed Internal
(LSI)
YYYYYYYY
OO----
(2)
OOOO-- --
OOOOO O
Wakeup
capability
--
Low Speed
External (LSE)
Multi-Speed
Internal (MSI)
Inter-Connect
Controller
OOOOO O
OOYY-- --
YYYYY --
RTCOOOOOOO
RTC TamperOOOOOOOO
Auto WakeUp
(AWU)
OOOOOOOO
USBOO------O--
USARTOOOOO
LPUARTOOOOO
(3)
(3)
O--
O--
SPIOOOO----
I2COO----O
(4)
O--
ADCOO--------
DACOOOOO--
DS10182 Rev 919/150
37
Functional overviewSTM32L052x6 STM32L052x8
IPsRun/ActiveSleep
Temperature
sensor
Table 5. Functionalities depending on the working mode
(from Run/active down to standby) (continued)
Low-
power
run
OOOOO --
Low-
power
sleep
(1)
StopStandby
Wakeup
capability
Wakeup
capability
ComparatorsOOOOOO--
16-bit timersOOOO----
LPTIMEROOOOOO
IWDGOOOOOOOO
WWDGOOOO----
Touch sensing
controller (TSC)
OO--------
SysTick TimerOOOO--
GPIOsOOOOOO2 pins
Wakeup time to
Run mode
Consumption
=1.8 to 3.6 V
V
DD
(Typ)
1. Legend:
“Y” = Yes (enable).
“O” = Optional can be enabled/disabled by software)
“-” = Not available
2. Some peripherals with wakeup from Stop capability can request HSI to be enabled. In this case, HSI is woken up by the
peripheral, and only feeds the peripheral which requested it. HSI is automatically put off when the peripheral does not need
it anymore.
3. UART and LPUART reception is functional in Stop mode. It generates a wakeup interrupt on Start. To generate a wakeup
on address match or received frame event, the LPUART can run on LSE clock while the UART has to wake up or keep
running the HSI clock.
4. I2C address detection is functional in Stop mode. It generates a wakeup interrupt in case of address match. It will wake up
the HSI during reception.
0 µs0.36 µs3 µs32 µs3.5 µs50 µs
0.4 µA (No
Down to
140 µA/MHz
(from Flash
memory)
Down to
37 µA/MHz
(from Flash
memory)
Down to
8 µA
Down to
4.5 µA
RTC) V
DD
0.8 µA (with
RTC) V
DD
0.4 µA (No
RTC) V
DD
=1.8 V
=1.8 V
=3.0 V
RTC) VDD=1.8 V
RTC) VDD=1.8 V
RTC) VDD=3.0 V
1 µA (with RTC)
V
DD
=3.0 V
RTC) VDD=3.0 V
0.28 µA (No
0.65 µA (with
0.29 µA (No
0.85 µA (with
20/150DS10182 Rev 9
STM32L052x6 STM32L052x8Functional overview
3.2 Interconnect matrix
Several peripherals are directly interconnected. This allows autonomous communication
between peripherals, thus saving CPU resources and power consumption. In addition,
these hardware connections allow fast and predictable latency.
Depending on peripherals, these interconnections can operate in Run, Sleep, Low-power
run, Low-power sleep and Stop modes.
The Cortex-M0+ processor is an entry-level 32-bit Arm Cortex processor designed for a
broad range of embedded applications. It offers significant benefits to developers, including:
•a simple architecture that is easy to learn and program
•upward compatibility with Cortex-M processor family
•platform security robustness, with integrated Memory Protection Unit (MPU).
The Cortex-M0+ processor is built on a highly area and power optimized 32-bit processor
core, with a 2-stage pipeline Von Neumann architecture. The processor delivers exceptional
energy efficiency through a small but powerful instruction set and extensively optimized
design, providing high-end processing hardware including a single-cycle multiplier.
The Cortex-M0+ processor provides the exceptional performance expected of a modern 32bit architecture, with a higher code density than other 8-bit and 16-bit microcontrollers.
Owing to its embedded Arm core, the STM32L052x6/8 are compatible with all Arm tools and
software.
Nested vectored interrupt controller (NVIC)
The ultra-low-power STM32L052x6/8 embed a nested vectored interrupt controller able to
handle up to 32 maskable interrupt channels and 4 priority levels.
The Cortex-M0+ processor closely integrates a configurable Nested Vectored Interrupt
Controller (NVIC), to deliver industry-leading interrupt performance. The NVIC:
•includes a Non-Maskable Interrupt (NMI)
•provides zero jitter interrupt option
•provides four interrupt priority levels
The tight integration of the processor core and NVIC provides fast execution of Interrupt
Service Routines (ISRs), dramatically reducing the interrupt latency. This is achieved
through the hardware stacking of registers, and the ability to abandon and restart loadmultiple and store-multiple operations. Interrupt handlers do not require any assembler
wrapper code, removing any code overhead from the ISRs. Tail-chaining optimization also
significantly reduces the overhead when switching from one ISR to another.
To optimize low-power designs, the NVIC integrates with the sleep modes, that include a
deep sleep function that enables the entire device to enter rapidly stop or standby mode.
This hardware block provides flexible interrupt management features with minimal interrupt
latency.
22/150DS10182 Rev 9
STM32L052x6 STM32L052x8Functional overview
3.4 Reset and supply management
3.4.1 Power supply schemes
•VDD = 1.65 to 3.6 V: external power supply for I/Os and the internal regulator. Provided
externally through V
•V
SSA
, V
= 1.65 to 3.6 V: external analog power supplies for ADC, DAC, reset
DDA
blocks, RCs and PLL (minimum voltage to be applied to V
•V
used). V
DD_USB
and V
DDA
= 1.65 to 3.6V: external power supply for USB transceiver, USB_DM (PA11)
and USB_DP (PA12). To guarantee a correct voltage level for USB communication
V
DD_USB
must be above 3.0V. If USB is not used this pin must be tied to VDD or VSS.
On packages without VDD_USB pin, V
voltage.
3.4.2 Power supply supervisor
The devices have an integrated ZEROPOWER power-on reset (POR)/power-down reset
(PDR) that can be coupled with a brownout reset (BOR) circuitry.
Two versions are available:
•The version with BOR activated at power-on operates between 1.8 V and 3.6 V.
•The other version without BOR operates between 1.65 V and 3.6 V.
pins.
DD
is 1.8 V when the DAC is
must be connected to VDD and VSS, respectively.
SSA
DD_USB
voltage is internally connected to VDD
DDA
After the V
threshold is reached (1.65 V or 1.8 V depending on the BOR which is active or
DD
not at power-on), the option byte loading process starts, either to confirm or modify default
thresholds, or to disable the BOR permanently: in this case, the VDD min value becomes
1.65 V (whatever the version, BOR active or not, at power-on).
When BOR is active at power-on, it ensures proper operation starting from 1.8 V whatever
the power ramp-up phase before it reaches 1.8 V. When BOR is not active at power-up, the
power ramp-up should guarantee that 1.65 V is reached on V
at least 1 ms after it exits
DD
the POR area.
Five BOR thresholds are available through option bytes, starting from 1.8 V to 3 V. To
reduce the power consumption in Stop mode, it is possible to automatically switch off the
internal reference voltage (V
V
is below a specified threshold, V
DD
) in Stop mode. The device remains in reset mode when
REFINT
POR/PDR
or V
, without the need for any external
BOR
reset circuit.
Note:The start-up time at power-on is typically 3.3 ms when BOR is active at power-up, the start-
up time at power-on can be decreased down to 1 ms typically for devices with BOR inactive
at power-up.
The devices feature an embedded programmable voltage detector (PVD) that monitors the
V
DD/VDDA
power supply and compares it to the V
threshold. This PVD offers 7 different
PVD
levels between 1.85 V and 3.05 V, chosen by software, with a step around 200 mV. An
interrupt can be generated when V
V
DD/VDDA
is higher than the V
PVD
DD/VDDA
threshold. The interrupt service routine can then generate
drops below the V
threshold and/or when
PVD
a warning message and/or put the MCU into a safe state. The PVD is enabled by software.
DS10182 Rev 923/150
37
Functional overviewSTM32L052x6 STM32L052x8
3.4.3 Voltage regulator
The regulator has three operation modes: main (MR), low power (LPR) and power down.
•MR is used in Run mode (nominal regulation)
•LPR is used in the Low-power run, Low-power sleep and Stop modes
•Power down is used in Standby mode. The regulator output is high impedance, the
kernel circuitry is powered down, inducing zero consumption but the contents of the
registers and RAM are lost except for the standby circuitry (wakeup logic, IWDG, RTC,
LSI, LSE crystal 32 KHz oscillator, RCC_CSR).
3.5 Clock management
The clock controller distributes the clocks coming from different oscillators to the core and
the peripherals. It also manages clock gating for low-power modes and ensures clock
robustness. It features:
•Clock prescaler
To get the best trade-off between speed and current consumption, the clock frequency
to the CPU and peripherals can be adjusted by a programmable prescaler.
•Safe clock switching
Clock sources can be changed safely on the fly in Run mode through a configuration
register.
•Clock management
To reduce power consumption, the clock controller can stop the clock to the core,
individual peripherals or memory.
•System clock source
Three different clock sources can be used to drive the master clock SYSCLK:
–1-25 MHz high-speed external crystal (HSE), that can supply a PLL
–16 MHz high-speed internal RC oscillator (HSI), trimmable by software, that can
supply a PLLMultispeed internal RC oscillator (MSI), trimmable by software, able
to generate 7 frequencies (65 kHz, 131 kHz, 262 kHz, 524 kHz, 1.05 MHz, 2.1
MHz, 4.2 MHz). When a 32.768 kHz clock source is available in the system (LSE),
the MSI frequency can be trimmed by software down to a ±0.5% accuracy.
•Auxiliary clock source
Two ultra-low-power clock sources that can be used to drive the real-time clock:
–32.768 kHz low-speed external crystal (LSE)
–37 kHz low-speed internal RC (LSI), also used to drive the independent watchdog.
The LSI clock can be measured using the high-speed internal RC oscillator for
greater precision.
•RTC clock source
The LSI, LSE or HSE sources can be chosen to clock the RTC, whatever the system
clock.
•USB clock source
A 48 MHz clock trimmed through the USB SOF supplies the USB interface.
24/150DS10182 Rev 9
STM32L052x6 STM32L052x8Functional overview
•Startup clock
After reset, the microcontroller restarts by default with an internal 2 MHz clock (MSI).
The prescaler ratio and clock source can be changed by the application program as
soon as the code execution starts.
•Clock security system (CSS)
This feature can be enabled by software. If an HSE clock failure occurs, the master
clock is automatically switched to HSI and a software interrupt is generated if enabled.
Another clock security system can be enabled, in case of failure of the LSE it provides
an interrupt or wakeup event which is generated if enabled.
It outputs one of the internal clocks for external use by the application.
Several prescalers allow the configuration of the AHB frequency, each APB (APB1 and
APB2) domains. The maximum frequency of the AHB and the APB domains is 32 MHz. See
Figure 2 for details on the clock tree.
DS10182 Rev 925/150
37
Functional overviewSTM32L052x6 STM32L052x8
MS33392V1
Legend:
HSE = High-speed external clock signal
HSI = High-speed internal clock signal
LSI = Low-speed internal clock signal
LSE = Low-speed external clock signal
MSI = Multispeed internal clock signal
Watchdog LS
LSI RC
LSE OSC
RTC
LSI tempo
@V33
/ 1,2,4,8,16
HSI16 RC
Level shifters
HSE OSC
Level shifters
RC 48MHz
Level shifters
LSU
1 MHz Clock
Detector
LSD
Clock
Recovery
System
/ 8
LSE tempo
MSI RC
Level shifters
/ 2,4,8,16
/ 2,3,4
Level shifters
PLL
X
3,4,6,8,12,16,
24,32,48
AHB
PRESC
/ 1,2,…, 512
Clock
Source
Control
@V33
@V33
@V33
@V33
@V33
@V18
@V18
@V18
@V18
@V18
usb_en
rng_en
48MHz
USBCLK
48MHz RNG
I2C1CLK
LPUART/
UARTCLK
LPTIMCLK
LSE
HSI16
SYSCLK
PCLK
LSI
not (sleep or
deepsleep)
not (sleep or
deepsleep)
not deepsleep
not deepsleep
HCLK
CK_PWR
FCLK
PLLCLK
HSE
HSI16
MSI
LSE
LSI
Dedicated 48MHz PLL output
HSE present or not
@V33
@V
DDCORE
ck_rchs
/ 1,4
HSI16
HSI48
MSI
1 MHz
ck_pllin
Enable Watchdog
RTC2 enable
ADC enable
ADCCLK
LSU LSD LSD
MCO
MCOSEL
PLLSRC
RTCSEL
System
Clock
APB1
PRESC
/ 1,2,4,8,16
Peripheral
clock enable
PCLK1 to APB1
peripherals
32 MHz
max.
If (APB1 presc=1) x1
else x2)
to TIMx
Peripheral
clock enable
APB2
PRESC
/ 1,2,4,8,16
Peripheral
clock enable
PCLK2 to APB2
peripherals
32 MHz
max.
If (APB2 presc=1) x1
else x2)
to TIMx
Peripheral
clock enable
Peripheral
clock enable
Peripheral
clock enable
SysTick
Timer
HSI48MSEL
Figure 2. Clock tree
26/150DS10182 Rev 9
STM32L052x6 STM32L052x8Functional overview
3.6 Low-power real-time clock and backup registers
The real time clock (RTC) and the 5 backup registers are supplied in all modes including
standby mode. The backup registers are five 32-bit registers used to store 20 bytes of user
application data. They are not reset by a system reset, or when the device wakes up from
Standby mode.
The RTC is an independent BCD timer/counter. Its main features are the following:
•Calendar with subsecond, seconds, minutes, hours (12 or 24 format), week day, date,
month, year, in BCD (binary-coded decimal) format
•Automatically correction for 28, 29 (leap year), 30, and 31 day of the month
•Two programmable alarms with wake up from Stop and Standby mode capability
•Periodic wakeup from Stop and Standby with programmable resolution and period
•On-the-fly correction from 1 to 32767 RTC clock pulses. This can be used to
synchronize it with a master clock.
•Reference clock detection: a more precise second source clock (50 or 60 Hz) can be
used to enhance the calendar precision.
•Digital calibration circuit with 1 ppm resolution, to compensate for quartz crystal
inaccuracy
•2 anti-tamper detection pins with programmable filter. The MCU can be woken up from
Stop and Standby modes on tamper event detection.
•Timestamp feature which can be used to save the calendar content. This function can
be triggered by an event on the timestamp pin, or by a tamper event. The MCU can be
woken up from Stop and Standby modes on timestamp event detection.
The RTC clock sources can be:
•A 32.768 kHz external crystal
•A resonator or oscillator
•The internal low-power RC oscillator (typical frequency of 37 kHz)
•The high-speed external clock
3.7 General-purpose inputs/outputs (GPIOs)
Each of the GPIO pins can be configured by software as output (push-pull or open-drain), as
input (with or without pull-up or pull-down) or as peripheral alternate function. Most of the
GPIO pins are shared with digital or analog alternate functions, and can be individually
remapped using dedicated alternate function registers. All GPIOs are high current capable.
Each GPIO output, speed can be slowed (40 MHz, 10 MHz, 2 MHz, 400 kHz). The alternate
function configuration of I/Os can be locked if needed following a specific sequence in order
to avoid spurious writing to the I/O registers. The I/O controller is connected to a dedicated
IO bus with a toggling speed of up to 32 MHz.
Extended interrupt/event controller (EXTI)
The extended interrupt/event controller consists of 28 edge detector lines used to generate
interrupt/event requests. Each line can be individually configured to select the trigger event
(rising edge, falling edge, both) and can be masked independently. A pending register
maintains the status of the interrupt requests. The EXTI can detect an external line with a
pulse width shorter than the Internal APB2 clock period. Up to 51 GPIOs can be connected
to the 16 configurable interrupt/event lines. The 12 other lines are connected to PVD, RTC,
USB, USARTs, LPUART, LPTIMER or comparator events.
DS10182 Rev 927/150
37
Functional overviewSTM32L052x6 STM32L052x8
3.8 Memories
The STM32L052x6/8 devices have the following features:
•8 Kbytes of embedded SRAM accessed (read/write) at CPU clock speed with 0 wait
states. With the enhanced bus matrix, operating the RAM does not lead to any
performance penalty during accesses to the system bus (AHB and APB buses).
•The non-volatile memory is divided into three arrays:
–32 or 64 Kbytes of embedded Flash program memory
–2 Kbytes of data EEPROM
–Information block containing 32 user and factory options bytes plus 4 Kbytes of
system memory
The user options bytes are used to write-protect or read-out protect the memory (with
4 Kbyte granularity) and/or readout-protect the whole memory with the following options:
•Level 0: no protection
•Level 1: memory readout protected.
The Flash memory cannot be read from or written to if either debug features are
connected or boot in RAM is selected
•Level 2: chip readout protected, debug features (Cortex-M0+ serial wire) and boot in
RAM selection disabled (debugline fuse)
The firewall protects parts of code/data from access by the rest of the code that is executed
outside of the protected area. The granularity of the protected code segment or the nonvolatile data segment is 256 bytes (Flash memory or EEPROM) against 64 bytes for the
volatile data segment (RAM).
The whole non-volatile memory embeds the error correction code (ECC) feature.
3.9 Boot modes
At startup, BOOT0 pin and nBOOT1 option bit are used to select one of three boot options:
•Boot from Flash memory
•Boot from System memory
•Boot from embedded RAM
The boot loader is located in System memory. It is used to reprogram the Flash memory by
using SPI1(PA4, PA5, PA6, PA7) or SPI2 (PB12, PB13, PB14, PB15), USART1(PA9,
PA10) or USART2(PA2, PA3). See STM32™ microcontroller system memory boot mode
AN2606 for details.
28/150DS10182 Rev 9
STM32L052x6 STM32L052x8Functional overview
3.10 Direct memory access (DMA)
The flexible 7-channel, general-purpose DMA is able to manage memory-to-memory,
peripheral-to-memory and memory-to-peripheral transfers. The DMA controller supports
circular buffer management, avoiding the generation of interrupts when the controller
reaches the end of the buffer.
Each channel is connected to dedicated hardware DMA requests, with software trigger
support for each channel. Configuration is done by software and transfer sizes between
source and destination are independent.
The DMA can be used with the main peripherals: SPI, I
general-purpose timers, DAC, and ADC.
2
C, USART, LPUART,
3.11 Analog-to-digital converter (ADC)
A native 12-bit, extended to 16-bit through hardware oversampling, analog-to-digital
converter is embedded into STM32L052x6/8 device. It has up to 16 external channels and 3
internal channels (temperature sensor, voltage reference). Three channels, PA0, PA4 and
PA5, are fast channels, while the others are standard channels.
The ADC performs conversions in single-shot or scan mode. In scan mode, automatic
conversion is performed on a selected group of analog inputs.
The ADC frequency is independent from the CPU frequency, allowing maximum sampling
rate of 1.14 MSPS even with a low CPU speed. The ADC consumption is low at all
frequencies (~25 µA at 10 kSPS, ~200 µA at 1MSPS). An auto-shutdown function
guarantees that the ADC is powered off except during the active conversion phase.
The ADC can be served by the DMA controller. It can operate from a supply voltage down to
1.65 V.
The ADC features a hardware oversampler up to 256 samples, this improves the resolution
to 16 bits (see AN2668).
An analog watchdog feature allows very precise monitoring of the converted voltage of one,
some or all scanned channels. An interrupt is generated when the converted voltage is
outside the programmed thresholds.
The events generated by the general-purpose timers (TIMx) can be internally connected to
the ADC start triggers, to allow the application to synchronize A/D conversions and timers.
3.12 Temperature sensor
The temperature sensor (T
temperature.
The temperature sensor is internally connected to the ADC_IN18 input channel which is
used to convert the sensor output voltage into a digital value.
The sensor provides good linearity but it has to be calibrated to obtain good overall
accuracy of the temperature measurement. As the offset of the temperature sensor varies
from chip to chip due to process variation, the uncalibrated internal temperature sensor is
suitable for applications that detect temperature changes only.
SENSE
) generates a voltage V
that varies linearly with
SENSE
DS10182 Rev 929/150
37
Functional overviewSTM32L052x6 STM32L052x8
To improve the accuracy of the temperature sensor measurement, each device is
individually factory-calibrated by ST. The temperature sensor factory calibration data are
stored by ST in the system memory area, accessible in read-only mode.
Calibration value nameDescriptionMemory address
TSENSE_CAL1
TSENSE_CAL2
Table 7. Temperature sensor calibration values
TS ADC raw data acquired at
temperature of 30 °C,
V
= 3 V
DDA
TS ADC raw data acquired at
temperature of 130 °C
V
= 3 V
DDA
0x1FF8 007A - 0x1FF8 007B
0x1FF8 007E - 0x1FF8 007F
3.12.1 Internal voltage reference (V
The internal voltage reference (V
ADC and Comparators. V
REFINT
enables accurate monitoring of the V
for ADC). The precise voltage of V
REFINT
is internally connected to the ADC_IN17 input channel. It
REFINT
REFINT
DD
)
) provides a stable (bandgap) voltage output for the
value (when no external voltage, V
is individually measured for each part by ST during
production test and stored in the system memory area. It is accessible in read-only mode.
Calibration value nameDescriptionMemory address
VREFINT_CAL
Table 8. Internal voltage reference measured values
Raw data acquired at
temperature of 25 °C
= 3 V
V
DDA
3.13 Digital-to-analog converter (DAC)
One 12-bit buffered DAC can be used to convert digital signal into analog voltage signal
output. An optional amplifier can be used to reduce the output signal impedance.
This digital Interface supports the following features:
•One data holding register
•Left or right data alignment in 12-bit mode
•Synchronized update capability
•Noise-wave generation
•Triangular-wave generation
•DMA capability (including the underrun interrupt)
•External triggers for conversion
•Input reference voltage V
Four DAC trigger inputs are used in the STM32L052x6/8. The DAC channel is triggered
through the timer update outputs that are also connected to different DMA channels.
REF+
, is available
REF+
0x1FF8 0078 - 0x1FF8 0079
30/150DS10182 Rev 9
Loading...
+ 120 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.