Table 59.TFBGA64 - 8 x 8 active ball array, 5 x 5 mm, 0.5 mm pitch, package mechanical data. . . 98
Table 60.UFBGA100 - ultra fine pitch ball grid array, 7 x 7 mm, 0.50 mm pitch, package
Figure 1 shows the general block diagram of the device family.
8/109 Doc ID 17659 Rev 6
STM32L151xx, STM32L152xxDescription
2 Description
The ultralow power STM32L15xxx incorporates the connectivity power of the universal
serial bus (USB) with the high-performance ARM Cortex
a 32
MHz frequency, a memory protection unit (MPU), high-speed embedded memories
(Flash memory up to 128
enhanced I/Os and peripherals connected to two APB buses. All devices offer a 12-bit ADC,
2 DACs and 2 ultralow power comparators, six general-purpose 16-bit timers and two basic
timers, which can be used as time bases. Moreover, the STM32L15xxx devices contain
standard and advanced communication interfaces: up to two I
and a USB. They also include a real-time clock and a set of backup registers that remain
powered in Standby mode. Finally, the integrated LCD controller has a built-in LCD voltage
generator that allows you to drive up to 8 multiplexed LCDs with contrast independent of the
supply voltage.
The ultralow power STM32L15xxx operates from a 1.8 to 3.6 V power supply (down to
1.65
V at power down) with BOR and from a 1.65 to 3.6 V power supply without BOR option.
It is available in the -40 to +85
modes allows the design of low-power applications.
Kbytes and RAM up to 16 Kbytes), and an extensive range of
°C temperature range. A comprehensive set of power-saving
™
-M3 32-bit RISC core operating at
2
Cs and SPIs, three USARTs
Doc ID 17659 Rev 69/109
DescriptionSTM32L151xx, STM32L152xx
2.1 Device overview
Table 2.Ultralow power STM32L15xxx device features and peripheral counts
Ambient temperatures: –40 to +85 °C
Junction temperature: –40 to + 105 °C
4x16
1.8 V to 3.6 V (down to 1.65 V at power-down)
1.65 V to 3.6 V without BOR option
4x32
8x28
with BOR option
4x44
8x40
.
10/109 Doc ID 17659 Rev 6
STM32L151xx, STM32L152xxDescription
2.2 Ultralow power device continuum
The ultralow power STM32L151xx and STM32L152xx are fully pin-to-pin, software and
feature compatible. Besides the full compatibility within the family, the devices are part of
STMicroelectronics microcontrollers ultralow power strategy which also includes
STM8L101xx and STM8L15xx devices. The STM8L and STM32L families allow a
continuum of performance, peripherals, system architecture and features.
They are all based on STMicroelectronics 0.13 µm ultralow leakage process.
Note:The ultralow power STM32L and general-purpose STM32Fxxxx families are pin-to-pin
compatible. The STM8L15xxx devices are pin-to-pin compatible with the STM8L101xx
devices. Please refer to the STM32F and STM8L documentation for more information on
these devices.
2.2.1 Performance
All families incorporate highly energy-efficient cores with both Harvard architecture and
pipelined execution: advanced STM8 core for STM8L families and ARM Cortex™-M3 core
for STM32L family. In addition specific care for the design architecture has been taken to
optimize the mA/DMIPS and mA/MHz ratios.
This allows the ultralow power performance to range from 5 up to 33.3 DMIPs.
2.2.2 Shared peripherals
STM8L15xxx and STM32L15xxx share identical peripherals which ensure a very easy
migration from one family to another:
●Analog peripherals: ADC, DAC, and comparators
●Digital peripherals: RTC and some communication interfaces
2.2.3 Common system strategy
To offer flexibility and optimize performance, the STM8L15xx and STM32L15xx families use
a common architecture:
●Same power supply range from 1.65 V to 3.6 V, (1.65 V at power down only for
STM8L15xx devices)
●Architecture optimized to reach ultralow consumption both in low power modes and
Run mode
●Fast startup strategy from low power modes
●Flexible system clock
●Ultrasafe reset: same reset strategy including power-on reset, power-down reset,
brownout reset and programmable voltage detector.
2.2.4 Features
ST ultralow power continuum also lies in feature compatibility:
●More than 10 packages with pin count from 20 to 100 pins and size down to 3 x 3 mm
●Memory density ranging from 4 to 128 Kbytes
Doc ID 17659 Rev 611/109
Functional overviewSTM32L151xx, STM32L152xx
%84)4
77$'
BIT!$#
*4!'37
!&
*4$)
*4#+37#+
*4-337$
.*4234
*4$/
.234
6$$6TO6
!&
!("
53"$0
53"$-
-/3)-)3/3#+.33
7+50
&
MAX
-(Z
6
33
3#,3$!3-"U S0-"U S
)#
6
$$2%&?!$#
'0$-!
4)-
4)-
84!,/3#
-(Z
84!,K(Z
/3#?).
/3#?/54
/3#?/54
/3#?).
0,,
!0"&
MAX
-(Z
!("0#, +
(#,+
CLOCK
MANAGEMENT
!0"0#, +
AS!&
AS!&
6/,4 2%'
6
#/2%
0/7%2
AS!&
4)-
"US -ATRI X
)NTER FACE
24#
2#(3
)BUS
$BUS
PBUS
OBL
&LASH
53"2!-"
53!24
53!24
30)
CHANNELS
3#,3$!
)#
AS!&
2848#43243
53!24
4EMPS ENSOR
6
332%&?!$#
!("&
MAX
-(Z
#HANN ELS
#HANN ELS
#HANN ELS
&#,+
)7$'
6$$
3UPPLY
MONITORING
6$$!
6$$!
633!
6$$!
3MART# ARDAS !&
2848#43243
3MART #ARD AS!&
2848#43243
3MART#A RDAS !&
!0" &
MAX
-(Z
.6)#
30)
-/3)-)3/
3#+.33AS!&
)&
6$$!
06$
0OWERRESET
)NT
!("
!0"
!0"
!7 5
6$$!
24#?!&
3YST EM
0!; =
0"; =
0#;=
0$;=
0%;=
,#$XX
3%'X
#/-X
)&)&)&
6$$!
$!#AS!&
$!#AS! &
-05
#OMP
#/-0?). ).
#OMP
4)-
4)--
4)-
4)-
4)-
#HANNE LS
#HANNEL
#HANNEL
'ENERALPURPOSE
TIMERS
+"&LASH
+"DATA%%02/-
,#$STEPUP
CONVERTER
6
,#$
6TO6
6
,#$
"!3)#4)-%23
3YNC (Z
62%&/54054
AIE
#ORTEX-#05
4RACECONTROLLER
%4-
2!-
+"
BIT$!#
BIT$!#
'0)/!
'0)/"
'0)/#
'0)/$
'0)/%
42!#%#+42!#%$
42!#%$42!#%$
42!#%$
2#-3
2#,3
3TANDBYINTERFACE
"ACKUPINTERFACE
53"&3DEVICE
"/262%&).4
0OWERUP
0OWERDOWN
"ACKUP
REGISTER
0(;=
'0)/(
3 Functional overview
Figure 1 shows the block diagrams.
Figure 1.Ultralow power STM32L15xxx block diagram
12/109 Doc ID 17659 Rev 6
1. AF = alternate function on I/O port pin.
STM32L151xx, STM32L152xxFunctional overview
3.1 Low power modes
The ultralow power STM32L15xxx supports 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:
●In range 1 (V
Table 13 for consumption).
●In range 2 (full V
consumption)
●In range 3 (full V
multispeed internal RC oscillator clock source). Refer to Table 13 for consumption.
Seven low power modes are provided to achieve the best compromise between low power
consumption, short startup time and available wakeup sources:
●Sleep mode
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: refer to Ta bl e 1 5.
●Low power run mode
This mode is achieved with the multispeed internal (MSI) RC oscillator set to the
minimum clock (65 kHz), execution from SRAM or Flash memory, and internal regulator
in low power mode to minimize the regulator's operating current. In the Low power run
mode, the clock frequency and the number of enabled peripherals are both limited.
Low power run mode consumption: refer to Table 16.
●Low power sleep mode
This mode is achieved by entering the Sleep mode with the internal voltage regulator in
Low power mode to minimize the regulator’s operating current. In the 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.
Low power sleep mode consumption: refer to Table 17.
●Stop mode (with or without RTC)
The Stop mode achieves the lowest power consumption while retaining the RAM and
register contents. All clocks in the V
RC and HSE crystal oscillators are disabled. The voltage regulator is in the low power
mode.
The device can be woken up from the Stop mode by any of the EXTI line, in 8 µs. The
EXTI line source can be one of the 16 external lines, the PVD output, the RTC alarm(s),
the USB wakeup, the RTC tamper event, the RTC timestamp event, the RTC Wakeup,
the Comparator 1 event or Comparator 2 event.
Stop mode consumption: refer to Tab le 18 .
range limited to 2.0-3.6 V), the CPU runs at up to 32 MHz (refer to
DD
range), the CPU runs at up to 16 MHz (refer to Table 13 for
DD
range), the CPU runs at up to 4 MHz (generated only with the
DD
domain are stopped, the PLL, MSI RC, HSI
CORE
Doc ID 17659 Rev 613/109
Functional overviewSTM32L151xx, STM32L152xx
●Standby mode (with or 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 RC and HSE 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 32K osc, RCC CSR).
The device exits the 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.
Standby mode consumption: refer to Table 19.
Note:The RTC, the IWDG, and the corresponding clock sources are not stopped by entering the
Stop or Standby mode.
3.2 ARM® Cortex™-M3 core with MPU
The ARM Cortex™-M3 processor is the latest generation of ARM processors for embedded
systems. It has been developed to provide a low-cost platform that meets the needs of MCU
implementation, with a reduced pin count and low-power consumption, while delivering
outstanding computational performance and an advanced system response to interrupts.
The ARM Cortex™-M3 32-bit RISC processor features exceptional code-efficiency,
delivering the high-performance expected from an ARM core in the memory size usually
associated with 8- and 16-bit devices.
The memory protection unit (MPU) improves system reliability by defining the memory
attributes (such as read/write access permissions) for different memory regions. It provides
up to eight different regions and an optional predefined background region.
Owing to its embedded ARM core, the STM32L15xxx is compatible with all ARM tools and
software.
Nested vectored interrupt controller (NVIC)
The ultralow power STM32L15xxx embeds a nested vectored interrupt controller able to
handle up to 45 maskable interrupt channels (not including the 16 interrupt lines of
Cortex™-M3) and 16 priority levels.
●Interrupt entry vector table address passed directly to the core
●Closely coupled NVIC core interface
●Allows early processing of interrupts
●Processing of late arriving, higher-priority interrupts
●Support for tail-chaining
●Processor state automatically saved
●Interrupt entry restored on interrupt exit with no instruction overhead
This hardware block provides flexible interrupt management features with minimal interrupt
latency.
14/109 Doc ID 17659 Rev 6
STM32L151xx, STM32L152xxFunctional overview
3.3 Reset and supply management
3.3.1 Power supply schemes
●V
●V
= 1.65 to 3.6 V: external power supply for I/Os and the internal regulator.
DD
Provided externally through V
, V
SSA
= 1.65 to 3.6 V: external analog power supplies for ADC, reset blocks, RCs
DDA
and PLL (minimum voltage to be applied to V
V
DDA
and V
must be connected to V
SSA
DD
pins.
is 1.8 V when the ADC is used).
DDA
and VSS, respectively.
DD
3.3.2 Power supply supervisor
The device has an integrated ZEROPOWER power-on reset (POR)/power-down reset
(PDR) that can be coupled with a brownout reset (BOR) circuitry.
For devices operating between 1.8 and 3.6 V, the BOR is always active at power-on and
ensures proper operation starting from 1.8
option byte loading process starts, either to confirm or modify default thresholds, or to
disable BOR permanently (in which case, the V
BOR thresholds are available through option bytes, starting from 1.8
power consumption in Stop mode, it is possible to automatically switch off the internal
reference voltage (V
below a specified threshold, V
) in Stop mode. The device remains in reset mode when V
REFINT
POR/PDR
circuit.
Note:For devices operating between 1.65 V and 3.6 V, the BOR is permanently disabled.
Consequently, the start-up time at power-on can be decreased down to 1ms typically.
The device features an embedded programmable voltage detector (PVD) that monitors the
V
DD/VDDA
levels between 1.85
interrupt can be generated when V
V
DD/VDDA
power supply and compares it to the V
V and 3.05 V, chosen by software, with a step around 200 mV. An
is higher than the V
DD/VDDA
threshold. The interrupt service routine can then generate
PVD
a warning message and/or put the MCU into a safe state. The PVD is enabled by software.
V. After the 1.8 V BOR threshold is reached, the
min value at power down is 1.65 V). Five
DD
V to 3 V. To reduce the
or V
, without the need for any external reset
BOR
threshold. This PVD offers 7 different
PVD
drops below the V
threshold and/or when
PVD
DD
is
3.3.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 are lost except for the standby circuitry (wakeup logic,
IWDG, RTC, LSI, LSE crystal 32K osc, RCC_CSR).
Doc ID 17659 Rev 615/109
Functional overviewSTM32L151xx, STM32L152xx
3.3.4 Boot modes
At startup, boot pins 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 USART1 or USART2. For further details please refer to AN2606.
3.4 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 tradeoff 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.
●Master clock source: three different clock sources can be used to drive the master
clock:
–1-24 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 PLL
–Multispeed internal RC oscillator (MSI), trimmable by software, able to generate 7
frequencies (65.5 kHz, 131 kHz, 262 kHz, 524 kHz, 1.05 MHz, 2.1 MHz, 4.2 MHz)
with a consumption proportional to speed, down to 750 nA typical. 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 ultralow power clock sources that can be used to drive the
LCD controller and 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 and LCD clock sources: the LSI, LSE or HSE sources can be chosen to clock
the RTC and the LCD, whatever the system clock.
●USB clock source: the embedded PLL has a dedicated 48 MHz clock output to supply
the USB interface.
●Startup clock: after reset, the microcontroller restarts by default with an internal
2.1 MHz clock (MSI). The prescaler ratio and clock source can be changed by the
application program as soon as the code execution starts.
16/109 Doc ID 17659 Rev 6
STM32L151xx, STM32L152xxFunctional overview
●Clock security system (CSS): this feature can be enabled by software. If a HSE clock
failure occurs, the master clock is automatically switched to HSI and a software
interrupt is generated if enabled.
●Clock-out capability (MCO: microcontroller clock output): it outputs one of the
internal clocks for external use by the application.
Several prescalers allow the configuration of the AHB frequency, the high-speed APB
(APB2) and the low-speed APB (APB1) domains. The maximum frequency of the AHB and
the APB domains is 32 MHz. See
Figure 2 for details on the clock tree.
Figure 2.Clock tree
/3#?/54
/3#?).
/3#?).
/3#?/54
-#/
-3)2#
-(Z
(3)2#
-(Z
(3%/3#
,3%/3#
K(Z
,3)2#
K(Z
(3)
0,,32#
,3%
-#/3%,
-3)
XXXX
XXX
24#3%,;=
,3)
393#,+
(3)
-3)
(3%
0,,#,+
,3)
,3%
0ERIPHERALCLOCK
ENABLE
0,,6#/
0,,-5,
XX
24##,+
TO)NDEPENDENT7ATCHDOG)7 $'
0RESCALER
0,,$)6
!("
TO
4IMER%42
TO24#
TO,#$
)7$'#,+
!$##,+
-(Z
53"#,+
TO53"INTERFACE
-(ZMAX
#LOCK
%NABLE
!0"
0RESCALER
)F!0"PRESCALERX
!0"
0RESCALER
)F!0"PRESCALERX
TO!$#
ELSEX
,EGEND
(3%(IGHSPEEDEXTERNALCLOCKSIGNAL
(3) (IGHSPEEDINTERNALCLOCKSIGNAL
,3),OWSPEEDINTERNALCLOCKSIGNAL
,3%,OWSPEEDEXTERNALCLOCKSIGNAL
-3)-ULTISPEEDINTERNALCLOCKSIGNAL
37
(3)
0,,#,+
(3%
#33
(#,+
TO!("BUSCORE
MEMORYAND$-!
TO#ORTEX3YSTEMTIMER
&#,+#ORTEX
FREERUNNINGCLOCK
-(ZMAX
0ERIPHERAL#LOCK
%NABLE
0ERIPHERAL#LOCK
%NABLE
-(ZMAX
0ERIPHERAL#LOCK
%NABLE
ELSEX
0ERIPHERAL#LOCK
%NABLE
393#,+
0#,+
TO!0"
PERIPHERALS
TO4)-AND
4)-X#,+
0#,+
PERIPHERALSTO!0"
TO4)-AND
4)-X#,+
-(Z
MAX
AIC
2. For the USB function to be available, both HSE and PLL must be enabled, with the CPU running at either
24 MHz or 32 MHz.
Doc ID 17659 Rev 617/109
Functional overviewSTM32L151xx, STM32L152xx
3.5 Low power real-time clock and backup registers
The real-time clock (RTC) is an independent BCD timer/counter. Dedicated registers 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 of the month are made
automatically. The RTC provides a programmable alarm and programmable periodic
interrupts with wakeup from Stop and Standby modes.
●The programmable wakeup time ranges from 120 µs to 36 hours
●Stop mode consumption with LSI and Auto-wakeup: 1.2 µA (at 1.8 V) and 1.4 µA (at
3.0 V)
●Stop mode consumption with LSE, calendar and Auto-wakeup: 1.3 µA (at 1.8V), 1.6 µA
(at 3.0 V)
The RTC can be calibrated with an external 512 Hz output, and a digital compensation
circuit helps reduce drift due to crystal deviation.
There are twenty 32-bit backup registers provided to store 80 bytes of user application data.
They are cleared in case of tamper detection.
3.6 GPIOs (general-purpose inputs/outputs)
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 AFIO registers. All GPIOs are high-current-capable. 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 the AHB with a toggling speed of up to 16 MHz.
External interrupt/event controller (EXTI)
The external interrupt/event controller consists of 23 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 83 GPIOs can be connected
to the 16 external interrupt lines.
18/109 Doc ID 17659 Rev 6
STM32L151xx, STM32L152xxFunctional overview
3.7 Memories
The STM32L15xxx devices have the following features:
●Up to 16 Kbyte of embedded RAM 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, 64 or 128 Kbyte of embedded Flash program memory
–4 Kbyte of data EEPROM
–Options bytes
The options bytes are used to write-protect the memory (with 4 KB granularity) and/or
readout-protect the whole memory with the following options:
–Level 0: no readout protection
–Level 1: memory readout protection, 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 protection, debug features (Cortex-M3 JTAG and serial wire)
and boot in RAM selection disabled (JTAG fuse)
The whole non-volatile memory embeds the error correction code (ECC) feature.
3.8 DMA (direct memory access)
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, I2C, USART, general-purpose timers
and ADC.
3.9 LCD (liquid crystal display)
The LCD drives up to 8 common terminals and 44 segment terminals to drive up to 320
pixels.
●Internal step-up converter to guarantee functionality and contrast control irrespective of
V
. This converter can be deactivated, in which case the V
DD
the voltage to the LCD
●Supports static, 1/2, 1/3, 1/4 and 1/8 duty
●Supports static, 1/2, 1/3 and 1/4 bias
●Phase inversion to reduce power consumption and EMI
●Up to 8 pixels can be programmed to blink
●Unneeded segments and common pins can be used as general I/O pins
●LCD RAM can be updated at any time owing to a double-buffer
●The LCD controller can operate in Stop mode
pin is used to provide
LCD
Doc ID 17659 Rev 619/109
Functional overviewSTM32L151xx, STM32L152xx
3.10 ADC (analog-to-digital converter)
A 12-bit analog-to-digital converters is embedded into STM32L15xxx devices with up to 24
external channels, performing conversions in single-shot or scan mode. In scan mode,
automatic conversion is performed on a selected group of analog inputs.
The ADC can be served by the DMA controller.
An analog watchdog feature allows very precise monitoring of the converted voltage of one,
some or all selected 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 trigger and injection trigger, to allow the application to synchronize A/D
conversions and timers.
The ADC includes a specific low power mode. The converter is able to operate at maximum
speed even if the CPU is operating at a very low frequency and has an auto-shutdown
function. The ADC’s runtime and analog front-end current consumption are thus minimized
whatever the MCU operating mode.
Temperature sensor
The temperature sensor has to generate a voltage that varies linearly with temperature. The
conversion range is between 1.8 V < V
connected to the ADC_IN16 input channel.
< 3.6 V. The temperature sensor is internally
DDA
3.11 DAC (digital-to-analog converter)
The two 12-bit buffered DAC channels can be used to convert two digital signals into two
analog voltage signal outputs. The chosen design structure is composed of integrated
resistor strings and an amplifier in non-inverting configuration.
This dual digital Interface supports the following features:
●two DAC converters: one for each output channel
●left or right data alignment in 12-bit mode
●synchronized update capability
●noise-wave generation
●triangular-wave generation
●dual DAC channels’ independent or simultaneous conversions
●DMA capability for each channel (including the underrun interrupt)
●external triggers for conversion
●input reference voltage V
Eight DAC trigger inputs are used in the STM32L15xxx. The DAC channels are triggered
through the timer update outputs that are also connected to different DMA channels.
REF+
20/109 Doc ID 17659 Rev 6
STM32L151xx, STM32L152xxFunctional overview
3.12 Ultralow power comparators and reference voltage
The STM32L15xxx embeds two comparators sharing the same current bias and reference
voltage. The reference voltage can be internal or external (coming from an I/O).
●one comparator with fixed threshold
●one comparator with rail-to-rail inputs, fast or slow mode. The threshold can be one of
the following:
–DAC output
–External I/O
–Internal reference voltage (V
REFINT
) or V
submultiple (1/4, 1/2, 3/4)
REFINT
Both comparators can wake up from Stop mode, and be combined into a window
comparator.
The internal reference voltage is available externally via a low power / low current output
buffer (driving current capability of 1
µA typical).
3.13 Routing interface
This interface controls the internal routing of I/Os to TIM2, TIM3, TIM4 and to the
comparator and reference voltage output.
3.14 Timers and watchdogs
The ultralow power STM32L15xxx devices include six general-purpose timers, two basic
timers and two watchdog timers.
Ta bl e 3 compares the features of the general-purpose and basic timers.
Table 3.Timer feature comparison
Timer
TIM2,
TIM3,
TIM4
TIM916-bitUp
TIM10,
TIM11
TIM6,
TIM7
Counter
resolution
16-bit
16-bitUp
16-bitUp
Counter
type
Up,
down,
up/down
Prescaler
Any integer
between 1
and 65536
Any integer
between 1
and 65536
Any integer
between 1
and 65536
Any integer
between 1
and 65536
factor
DMA request
generation
Ye s4N o
No2No
No1No
Ye s0N o
Capture/compare
channels
Complementary
outputs
Doc ID 17659 Rev 621/109
Functional overviewSTM32L151xx, STM32L152xx
3.14.1 General-purpose timers (TIM2, TIM3, TIM4, TIM9, TIM10 and TIM11)
There are six synchronizable general-purpose timers embedded in the STM32L15xxx
devices (see
TIM2, TIM3, TIM4
These timers are based on a 16-bit auto-reload up/downcounter and a 16-bit prescaler.
They feature 4 independent channels each for input capture/output compare, PWM or onepulse mode output. This gives up to 12 input captures/output compares/PWMs on the
largest packages.
The TIM2, TIM3, TIM4 general-purpose timers can work together or with the TIM10, TIM11
and TIM9 general-purpose timers via the Timer Link feature for synchronization or event
chaining. Their counter can be frozen in debug mode. Any of the general-purpose timers
can be used to generate PWM outputs.
TIM2, TIM3, TIM4 all have independent DMA request generation.
These timers are capable of handling quadrature (incremental) encoder signals and the
digital outputs from 1 to 3 hall-effect sensors.
TIM10, TIM11 and TIM9
These timers are based on a 16-bit auto-reload upcounter and a 16-bit prescaler. TIM10 and
TIM11 feature one independent channel, whereas TIM9 has two independent channels for
input capture/output compare, PWM or one-pulse mode output. They can be synchronized
with the TIM2, TIM3, TIM4 full-featured general-purpose timers.
Ta bl e 3 for differences).
They can also be used as simple time bases and be clocked by the LSE clock source
(32.768 kHz) to provide time bases independent from the main CPU clock.
3.14.2 Basic timers (TIM6 and TIM7)
These timers are mainly used for DAC trigger generation. They can also be used as generic
16-bit time bases.
3.14.3 SysTick timer
This timer is dedicated to the OS, but could also be used as a standard downcounter. It is
based on a 24-bit downcounter with autoreload capability and a programmable clock
source. It features a maskable system interrupt generation when the counter reaches 0.
3.14.4 Independent watchdog (IWDG)
The independent watchdog is based on a 12-bit downcounter and 8-bit prescaler. It is
clocked from an independent 37 kHz internal RC and, as it operates independently of the
main clock, it can operate in Stop and Standby modes. It can be used either as a watchdog
to reset the device when a problem occurs, or as a free-running timer for application timeout
management. It is hardware- or software-configurable through the option bytes. The counter
can be frozen in debug mode.
22/109 Doc ID 17659 Rev 6
STM32L151xx, STM32L152xxFunctional overview
3.14.5 Window watchdog (WWDG)
The window watchdog is based on a 7-bit downcounter that can be set as free-running. It
can be used as a watchdog to reset the device when a problem occurs. It is clocked from the
main clock. It has an early warning interrupt capability and the counter can be frozen in
debug mode.
3.15 Communication interfaces
3.15.1 I²C bus
Up to two I²C bus interfaces can operate in multimaster and slave modes. They can support
standard and fast modes.
They support dual slave addressing (7-bit only) and both 7- and 10-bit addressing in master
mode. A hardware CRC generation/verification is embedded.
They can be served by DMA and they support SM Bus 2.0/PM Bus.
All USART interfaces are able to communicate at speeds of up to 4 Mbit/s. They provide
hardware management of the CTS and RTS signals. They support IrDA SIR ENDEC, are
ISO 7816 compliant and have LIN Master/Slave capability.
All USART interfaces can be served by the DMA controller.
3.15.3 Serial peripheral interface (SPI)
Up to two SPIs are able to communicate at up to 16 Mbits/s in slave and master modes in
full-duplex and simplex communication modes. The 3-bit prescaler gives 8 master mode
frequencies and the frame is configurable to 8 bits or 16 bits. The hardware CRC
generation/verification supports basic SD Card/MMC modes.
Both SPIs can be served by the DMA controller.
3.15.4 Universal serial bus (USB)
The STM32L15xxx embeds a USB device peripheral compatible with the USB full speed
12
Mbit/s. The USB interface implements a full speed (12 Mbit/s) function interface. It has
software-configurable endpoint setting and supports suspend/resume. The dedicated
48
MHz clock is generated from the internal main PLL (the clock source must use a HSE
crystal oscillator).
Doc ID 17659 Rev 623/109
Functional overviewSTM32L151xx, STM32L152xx
3.16 CRC (cyclic redundancy check) calculation unit
The CRC (cyclic redundancy check) calculation unit is used to get a CRC code from a 32-bit
data word and a fixed generator polynomial.
Among other applications, CRC-based techniques are used to verify data transmission or
storage integrity. In the scope of the EN/IEC 60335-1 standard, they offer a means of
verifying the Flash memory integrity. The CRC calculation unit helps compute a signature of
the software during runtime, to be compared with a reference signature generated at linktime and stored at a given memory location.
3.17 Development support
Serial wire JTAG debug port (SWJ-DP)
The ARM SWJ-DP interface is embedded, and is a combined JTAG and serial wire debug
port that enables either a serial wire debug or a JTAG probe to be connected to the target.
The JTAG TMS and TCK pins are shared with SWDIO and SWCLK, respectively, and a
specific sequence on the TMS pin is used to switch between JTAG-DP and SW-DP.
The JTAG port can be permanently disabled with a JTAG fuse.
Embedded Trace Macrocell™
The ARM® Embedded Trace Macrocell provides a greater visibility of the instruction and
data flow inside the CPU core by streaming compressed data at a very high rate from the
STM32L15xxx through a small number of ETM pins to an external hardware trace port
analyzer (TPA) device. The TPA is connected to a host computer using USB, Ethernet, or
any other high-speed channel. Real-time instruction and data flow activity can be recorded
and then formatted for display on the host computer running debugger software. TPA
hardware is commercially available from common development tool vendors. It operates
with third party debugger software tools.