ST STM32L151CB, STM32L151C8, STM32L151C6, STM32L151RB, STM32L151R8 User Manual

...
STM32L151xx
LQFP100 14 × 14 mm
LQFP64 10 × 10 mm
LQFP48 7 × 7 mm
BGA100 7 × 7 mm
BGA64 5 × 5 mm
UFQFPN48
7 × 7 mm
STM32L152xx
Ultralow power ARM-based 32-bit MCU with up to 128 KB Flash,
RTC, LCD, USB, USART, I2C, SPI, timers, ADC, DAC, comparators
Features
Operating conditions
– Operating power supply range: 1.65 V to
– Temperature range: –40 to 85 °C
Low power features
– 4 modes: Sleep, Low-power run (9 µA at
32 kHz), Low-power sleep (4.4 µA), Stop with RTC (1.45 µA), Stop (570 nA), Standby (300 nA)
– Dynamic core voltage scaling down to
233 µA/MHz – Ultralow leakage per I/O: 50 nA – Fast wakeup from Stop: 8 µs – Three wakeup pins
Core: ARM 32-bit Cortex
-M3 CPU
– 32 MHz maximum frequency,
33.3 DMIPS peak (Dhrystone 2.1)
– Memory protection unit
Reset and supply management
– Low power, ultrasafe BOR (brownout reset)
with 5 selectable thresholds – Ultralow power POR/PDR – Programmable voltage detector (PVD)
Clock management
– 1 to 24 MHz crystal oscillator – 32 kHz oscillator for RTC with calibration – Internal 16 MHz factory-trimmed RC – Internal 37 kHz low consumption RC – Internal multispeed low power RC, 65 kHz
to 4.2 MHz with consumption down to
1.5 µA
– PLL for CPU clock and USB (48 MHz)
Low power calendar RTC
– Alarm, periodic wakeup from Stop/Standby
Memories
– Up to 128 Kbyte of Flash memory with ECC – 4 Kbyte of data EEPROM with ECC
– Up to 16 Kbyte of RAM
Up to 83 fast I/Os (73 of which are 5 V-tolerant)
all mappable on 16 external interrupt vectors
Development support
– Serial wire debug, JTAG and trace
DMA: 7-channel DMA controller, supporting
timers, ADC, SPIs, I
LCD 8 × 40 or 4 × 44 with step-up converter
12-bit ADC up to 1 Msps/24 channels
2
Cs and USARTs
– Temperature sensor and internal voltage
reference
– Operates down to 1.8 V
2 × 12-bit DACs with output buffers
2 ultralow power comparators
– Window mode and wakeup capability
10 timers:
– 6 × 16-bit general-purpose timers, each
with up to 4 IC/OC/PWM channels – 2 × 16-bit basic timers – 2 × watchdog timers (independent and
window)
Up to 8 communication interfaces
– Up to 2 × I
2
C interfaces (SMBus/PMBus)
– Up to 3 × USARTs (ISO 7816 interface,
LIN, IrDA capability, modem control) – Up to 2 × SPIs (16 Mbit/s) – USB 2.0 full speed interface
CRC calculation unit, 96-bit unique ID

Table 1. Device summary

Reference Part number
STM32L151xx
STM32L152xx
STM32L151CB, STM32L151C8, STM32L151C6, STM32L151RB, STM32L151R8, STM32L151R6, STM32L151VB, STM32L151V8
STM32L152CB, STM32L152C8, STM32L152C6, STM32L152RB, STM32L152R8, STM32L152R6, STM32L152VB, STM32L152V8
January 2012 Doc ID 17659 Rev 6 1/109
www.st.com
1
Contents STM32L151xx, STM32L152xx
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1 Device overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2 Ultralow power device continuum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2.1 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2.2 Shared peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2.3 Common system strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2.4 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3 Functional overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.1 Low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.2 ARM® Cortex™-M3 core with MPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.3 Reset and supply management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3.1 Power supply schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3.2 Power supply supervisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3.3 Voltage regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3.4 Boot modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.4 Clock management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5 Low power real-time clock and backup registers . . . . . . . . . . . . . . . . . . . 18
3.6 GPIOs (general-purpose inputs/outputs) . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.7 Memories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.8 DMA (direct memory access) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.9 LCD (liquid crystal display) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.10 ADC (analog-to-digital converter) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.11 DAC (digital-to-analog converter) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.12 Ultralow power comparators and reference voltage . . . . . . . . . . . . . . . . . 21
3.13 Routing interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.14 Timers and watchdogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.14.1 General-purpose timers (TIM2, TIM3, TIM4, TIM9, TIM10 and TIM11) 22
3.14.2 Basic timers (TIM6 and TIM7) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.14.3 SysTick timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.14.4 Independent watchdog (IWDG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2/109 Doc ID 17659 Rev 6
STM32L151xx, STM32L152xx Contents
3.14.5 Window watchdog (WWDG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.15 Communication interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.15.1 I²C bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.15.2 Universal synchronous/asynchronous receiver transmitter (USART) . . 23
3.15.3 Serial peripheral interface (SPI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.15.4 Universal serial bus (USB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.16 CRC (cyclic redundancy check) calculation unit . . . . . . . . . . . . . . . . . . . 24
3.17 Development support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4 Pin descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5 Memory mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
6 Electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.1 Parameter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.1.1 Minimum and maximum values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.1.2 Typical values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.1.3 Typical curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.1.4 Loading capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.1.5 Pin input voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.1.6 Power supply scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
6.1.7 Current consumption measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
6.2 Absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.3 Operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.3.1 General operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.3.2 Embedded reset and power control block characteristics . . . . . . . . . . . 46
6.3.3 Embedded internal reference voltage . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6.3.4 Supply current characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.3.5 External clock source characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.3.6 Internal clock source characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
6.3.7 PLL characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
6.3.8 Memory characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
6.3.9 EMC characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.3.10 Absolute maximum ratings (electrical sensitivity) . . . . . . . . . . . . . . . . . 71
6.3.11 I/O current injection characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
6.3.12 I/O port characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
6.3.13 NRST pin characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Doc ID 17659 Rev 6 3/109
Contents STM32L151xx, STM32L152xx
6.3.14 TIM timer characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
6.3.15 Communications interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
6.3.16 12-bit ADC characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
6.3.17 DAC electrical specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
6.3.18 Temperature sensor characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
6.3.19 Comparator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
6.3.20 LCD controller (STM32L152xx only) . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
7 Package characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
7.1 Package mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
7.2 Thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
7.2.1 Reference document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
8 Ordering information scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
9 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
4/109 Doc ID 17659 Rev 6
STM32L151xx, STM32L152xx List of tables
List of tables
Table 1. Device summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Table 2. Ultralow power STM32L15xxx device features and peripheral counts . . . . . . . . . . . . . . . . 10
Table 3. Timer feature comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Table 4. STM32L15xxx pin definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Table 5. Alternate function input/output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Table 6. Voltage characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Table 7. Current characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Table 8. Thermal characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Table 9. General operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Table 10. Functionalities depending on the operating power supply range . . . . . . . . . . . . . . . . . . . . 45
Table 11. Embedded reset and power control block characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . 46
Table 12. Embedded internal reference voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Table 13. Current consumption in Run mode, code with data processing running from Flash. . . . . . 49
Table 14. Current consumption in Run mode, code with data processing running from RAM . . . . . . 50
Table 15. Current consumption in Sleep mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Table 16. Current consumption in Low power run mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Table 17. Current consumption in Low power sleep mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Table 18. Typical and maximum current consumptions in Stop mode . . . . . . . . . . . . . . . . . . . . . . . . 54
Table 19. Typical and maximum current consumptions in Standby mode . . . . . . . . . . . . . . . . . . . . . 55
Table 20. Typical and maximum timings in Low power modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Table 21. Peripheral current consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Table 22. High-speed external user clock characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Table 23. Low-speed external user clock characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Table 24. HSE 1-24 MHz oscillator characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Table 25. LSE oscillator characteristics (f
Table 26. HSI oscillator characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Table 27. LSI oscillator characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Table 28. MSI oscillator characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Table 29. PLL characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Table 30. RAM and hardware registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Table 31. Flash memory characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Table 32. Flash memory endurance and data retention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Table 33. EMS characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Table 34. EMI characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Table 35. ESD absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Table 36. Electrical sensitivities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Table 37. I/O current injection susceptibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Table 38. I/O static characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Table 39. Output voltage characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Table 40. I/O AC characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Table 41. NRST pin characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Table 42. TIMx characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Table 43. I Table 44. SCL frequency (f
Table 45. SPI characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Table 46. USB startup time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Table 47. USB DC electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Table 48. USB: full speed electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
2
C characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
= 32 MHz, VDD = 3.3 V) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
PCLK1
= 32.768 kHz) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
LSE
Doc ID 17659 Rev 6 5/109
List of tables STM32L151xx, STM32L152xx
Table 49. ADC clock frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Table 50. ADC characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Table 51. ADC accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Table 52. R
max for f
AIN
= 16 MHz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
ADC
Table 53. DAC characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Table 54. TS characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Table 55. Comparator 1 characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Table 56. Comparator 2 characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Table 57. LCD controller characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Table 58. UFQFPN48 – ultra thin fine pitch quad flat pack no-lead 7 × 7 mm, 0.5 mm
pitch package mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
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
mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Table 61. LQPF100, 14 x 14 mm, 100-pin low-profile quad flat package mechanical data . . . . . . . 101
Table 62. LQFP64, 10 x 10 mm, 64-pin low-profile quad flat package mechanical data . . . . . . . . . 102
Table 63. LQFP48, 7 x 7 mm, 48-pin low-profile quad flat package mechanical data . . . . . . . . . . . 103
Table 64. Thermal characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Table 65. Ordering information scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
6/109 Doc ID 17659 Rev 6
STM32L151xx, STM32L152xx List of figures
List of figures
Figure 1. Ultralow power STM32L15xxx block diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Figure 2. Clock tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Figure 3. STM32L15xxx UFBGA100 ballout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Figure 4. STM32L15xxx TFBGA64 ballout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Figure 5. STM32L15xxx LQFP100 pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 6. STM32L15xxx LQFP64 pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Figure 7. STM32L15xxx LQFP48 pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Figure 8. STM32L15xxx UFQFPN48 pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Figure 9. Memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Figure 10. Pin loading conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Figure 11. Pin input voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Figure 12. Power supply scheme. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Figure 13. Current consumption measurement scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Figure 14. Low-speed external clock source AC timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Figure 15. High-speed external clock source AC timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Figure 16. HSE oscillator circuit diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Figure 17. Typical application with a 32.768 kHz crystal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Figure 18. I/O AC characteristics definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Figure 19. Recommended NRST pin protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Figure 20. I
Figure 21. SPI timing diagram - slave mode and CPHA = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Figure 22. SPI timing diagram - slave mode and CPHA = 1 Figure 23. SPI timing diagram - master mode
Figure 24. USB timings: definition of data signal rise and fall time . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Figure 25. ADC accuracy characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Figure 26. Typical connection diagram using the ADC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Figure 27. Maximum dynamic current consumption on V
Figure 28. Power supply and reference decoupling (V Figure 29. Power supply and reference decoupling (V
Figure 30. 12-bit buffered /non-buffered DAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Figure 31. UFQFPN48 7 x 7 mm, 0.5 mm pitch, package outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Figure 32. Recommended footprint (dimensions in mm)
Figure 33. TFBGA64 - 8 x 8 active ball array, 5 x 5 mm, 0.5 mm pitch, package outline . . . . . . . . . . 98
Figure 34. Recommended PCB design rules for pads (0.5 mm pitch BGA) . . . . . . . . . . . . . . . . . . . . 99
Figure 35. UFBGA100 - ultra fine pitch ball grid array, 7 x 7 mm, 0.50 mm pitch,
Figure 36. LQFP100, 14 x 14 mm, 100-pin low-profile quad flat package outline . . . . . . . . . . . . . . . 101
Figure 37. Recommended footprint
Figure 38. LQFP64, 10 x 10 mm, 64-pin low-profile quad flat package outline . . . . . . . . . . . . . . . . . 102
Figure 39. Recommended footprint
Figure 40. LQFP48, 7 x 7 mm, 48-pin low-profile quad flat package outline . . . . . . . . . . . . . . . . . . . 103
Figure 41. Recommended footprint
2
C bus AC waveforms and measurement circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
(1)
(1)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
supply pin during ADC
REF+
conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
not connected to V
REF+
connected to V
REF+
(1)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
DDA
). . . . . . . . . . . . . . 89
DDA
). . . . . . . . . . . . . . . . . 89
package outline. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
(1)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
(1)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
(1)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Doc ID 17659 Rev 6 7/109
Introduction STM32L151xx, STM32L152xx

1 Introduction

This datasheet provides the ordering information and mechanical device characteristics of
the STM32L151xx and STM32L152xx ultralow power ARM Cortex™-based microcontrollers
product line.
The ultralow power STM32L15xxx family includes devices in 3 different package types: from
48 pins to 100 pins. Depending on the device chosen, different sets of peripherals are
included, the description below gives an overview of the complete range of peripherals
proposed in this family.
These features make the ultralow power STM32L15xxx microcontroller family suitable for a
wide range of applications:
Medical and handheld equipment
Application control and user interface
PC peripherals, gaming, GPS and sport equipment
Alarm systems, Wired and wireless sensors, Video intercom
Utility metering
For information on the Cortex™-M3 core please refer to the Cortex™-M3 Technical
Reference Manual, available from the www.arm.com website at the following address:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0337g.
Figure 1 shows the general block diagram of the device family.
8/109 Doc ID 17659 Rev 6
STM32L151xx, STM32L152xx Description

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 6 9/109
Description STM32L151xx, STM32L152xx

2.1 Device overview

Table 2. Ultralow power STM32L15xxx device features and peripheral counts

Flash - Kbytes 32 64 128 32 64 128 64 128
RAM - Kbytes 10 10 16 10 10 16 10 16
Timers
Communication interfaces
GPIOs 37 51 83
12-bit synchronized ADC
Number of channels
12-bit DAC
Number of channels
Peripheral
General­purpose
Basic 222
SPI 222
2
I
USART 333
USB 111
STM32L15xCx STM32L15xRx STM32L15xVx
666
C 222
1
16 channels
2 2
1
20 channels
2 2
1
24 channels
2 2
LCD (STM32L152xx Only)
COM x SEG
Comparator 222
CPU frequency 32 MHz
Operating voltage
Operating temperatures
Packages LQFP48, UFQFPN48 LQFP64, BGA64 LQFP100, BGA100
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, STM32L152xx Description

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 6 11/109
Functional overview STM32L151xx, STM32L152xx
%84)4
77$'
BIT!$#
*4!'37
!&
*4$)
*4#+37#+
*4-337$
.*4234
*4$/
.234
6$$6TO6
!&
!("
53"$0 53"$-
-/3)-)3/3#+.33
7+50
&
MAX
-(Z
6
33
3#,3$!3-"U S0-"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!&
2848#43243
53!24
4EMPS ENSOR
6
332%&?!$#
!("&
MAX
-(Z
#HANN ELS
#HANN ELS
#HANN ELS
&#,+
)7$'
6$$
3UPPLY
MONITORING
6$$!
6$$!
633!
6$$!
3MART# ARDAS !&
2848#43243 3MART #ARD AS!&
2848#43243 3MART#A RDAS !&
!0" &
MAX
-(Z
.6)#
30)
-/3)-)3/
3#+.33AS!&
)&
6$$!
06$
0OWERRESET
)NT
!("
!0"
!0"
!7 5
6$$!
24#?!&
3YST EM
0!; =
0"; =
0#;=
0$;=
0%;=
,#$XX
3%'X
#/-X
)&)&)&
6$$!
$!#AS!&
$!#AS! &
-05
#OMP 
#/-0?). ).
#OMP 
4)-
4)--
4)-
4)-
4)-
#HANNE LS
#HANNEL
#HANNEL
'ENERALPURPOSE
TIMERS
+"&LASH
+"DATA%%02/-
,#$STEPUP
CONVERTER
6
,#$
6TO6
6
,#$
"!3)#4)-%23
3YNC (Z
62%&/54054
AIE
#ORTEX-#05
4RACECONTROLLER
%4-
2!-
+"
BIT$!#
BIT$!#
'0)/!
'0)/"
'0)/#
'0)/$
'0)/%
42!#%#+42!#%$ 42!#%$42!#%$ 42!#%$
2#-3
2#,3
3TANDBYINTERFACE
"ACKUPINTERFACE
53"&3DEVICE
"/262%&).4
0OWERUP
0OWERDOWN
"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, STM32L152xx Functional 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 6 13/109
Functional overview STM32L151xx, 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.
Closely coupled NVIC gives low-latency interrupt processing
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, STM32L152xx Functional 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 6 15/109
Functional overview STM32L151xx, 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, STM32L152xx Functional 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)
XXXX
XXX
24#3%,;=
,3)
393#,+
(3)
-3) (3%
0,,#,+ ,3) ,3%
0ERIPHERALCLOCK ENABLE
0,,6#/
0,,-5,
XX
24##,+
TO)NDEPENDENT7ATCHDOG)7 $'
0RESCALER 
0,,$)6

!("
TO 4IMER%42
TO24#
TO,#$
)7$'#,+
!$##,+
-(Z
53"#,+
TO53"INTERFACE
-(ZMAX
#LOCK
%NABLE

!0"
0RESCALER

)F!0"PRESCALERX
!0"
0RESCALER

)F!0"PRESCALERX
TO!$#
ELSEX
,EGEND
(3%(IGHSPEEDEXTERNALCLOCKSIGNAL
(3) (IGHSPEEDINTERNALCLOCKSIGNAL
,3),OWSPEEDINTERNALCLOCKSIGNAL
,3%,OWSPEEDEXTERNALCLOCKSIGNAL
-3)-ULTISPEEDINTERNALCLOCKSIGNAL
37
(3)
0,,#,+
(3%
#33
(#,+ TO!("BUSCORE MEMORYAND$-!
TO#ORTEX3YSTEMTIMER
&#,+#ORTEX FREERUNNINGCLOCK
-(ZMAX
0ERIPHERAL#LOCK %NABLE
0ERIPHERAL#LOCK
%NABLE
-(ZMAX
0ERIPHERAL#LOCK
%NABLE
ELSEX
0ERIPHERAL#LOCK %NABLE

393#,+
0#,+
TO!0" PERIPHERALS
TO4)-AND
4)-X#,+
0#,+
PERIPHERALSTO!0"
TO4)-AND
4)-X#,+
-(Z
MAX
AIC
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 6 17/109
Functional overview STM32L151xx, 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, STM32L152xx Functional 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 6 19/109
Functional overview STM32L151xx, 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, STM32L152xx Functional 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
TIM9 16-bit Up
TIM10,
TIM11
TIM6,
TIM7
Counter
resolution
16-bit
16-bit Up
16-bit Up
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 s 4 N o
No 2 No
No 1 No
Ye s 0 N o
Capture/compare
channels
Complementary
outputs
Doc ID 17659 Rev 6 21/109
Functional overview STM32L151xx, 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 one­pulse 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, STM32L152xx Functional 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.

3.15.2 Universal synchronous/asynchronous receiver transmitter (USART)

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 6 23/109
Functional overview STM32L151xx, 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 link­time 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.
24/109 Doc ID 17659 Rev 6
STM32L151xx, STM32L152xx Pin descriptions
ai17096d
A
B
E
D
C
F
G
H
J
K
L
M
PE3
OSC_IN
PC15 OSC32_OUT
PC14
RTC_AF1 WKUP2
PE4
OSC_OUT
PC0
VSSA
VREF-
VREF+
VDDA
PE1
PE5
PE2
PE6 WUKP3
VLCD
VSS_5
VDD_5
NRST
PC1
PC3
PA 0 WKUP1
PA 1
PB8
PE0
PB9
VSS_3
VSS_4
VDD_4
PC2
PA 2
PA 3
PA 4
BOOT0
PB7
VDD_3
PA 5
PA 6
PA 7
PD7
PB6
PB5
PC4
PC5
PB0
PD5
PD6
PB2
PB1
PB4
PD4
PE8
PE7
PB3
PD3
PD2
PD9
PE10
PE9
PA15
PD1
PD0
PD8
PE12
PE11
PA14
PC12
PC11
PC8
PA 9
PD15
PD12
PB15
PB10
PE13
PA 13
PC10
PH2
PA 8
PC7
PD14
PD11
PB14
PB11
PE14
VSS_2
VDD_2
PA12
PA11
PA10
PC9
PC6
PD13
PD10
PB13
PB12
PE15
VSS_1
VDD_1
2 3 4 5 6 7 8 9 10 11 12
1
PC13
PH0
PH1
OSC32_IN

4 Pin descriptions

Figure 3. STM32L15xxx UFBGA100 ballout

Doc ID 17659 Rev 6 25/109
Pin descriptions STM32L151xx, STM32L152xx
AI16090b
PB2
PC14-
OSC32_IN
PA7PA4
PA2
PA15
PB11
PB1PA6PA3
H
PB10
PC5PC4
D PA8
PA9
BOOT0PB8
C
PC9
PA11
PB6
PC12
V
DDA
PB9
B
PA12
PC10
PC15-
OSC32_OUT
PB3
PD2
A
87654321
V
SS_4
OSC_IN
OSC_OUT V
DD_4
G
F
E
PC2
V
REF+
PC13-
RTC_AF1
PB4 PA13PA14
PB7
PB5
V
SS_3
PC7 PC8PC0NRST PC1
PB0PA5 PB14
V
DD_2
V
DD_3
PB13
VLCD
PC11
PA10
V
SS_2
V
SS_1
PC6V
SSA
PA1
V
DD_1
PB15
PB12
PA0-WKUP1
PH0-
PH1-
-
WKUP2

Figure 4. STM32L15xxx TFBGA64 ballout

26/109 Doc ID 17659 Rev 6
STM32L151xx, STM32L152xx Pin descriptions
100999897969594939291908988878685848382818079787776
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51
VDD_2 VSS_2 PH2 PA 1 3 PA 1 2 PA 1 1 PA 1 0 PA 9 PA 8 PC9 PC8 PC7 PC6 PD15 PD14 PD13 PD12 PD11 PD10 PD9 PD8 PB15 PB14 PB13 PB12
PA 3
VSS_4
VDD_4
PA 4
PA 5
PA 6
PA 7
PC4
PC5
PB0
PB1
PB2
PE7
PE8
PE9
PE10
PE11
PE12
PE13
PE14
PE15
PB10
PB11
VSS_1
VDD_1
VDD_3
VSS_3
PE1
PE0
PB9
PB8
BOOT0
PB7
PB6
PB5
PB4
PB3
PD7
PD6
PD5
PD4
PD3
PD2
PD1
PD0
PC12
PC11
PC10
PA15
PA14
26272829303132333435363738394041424344454647484950
PE2 PE3 PE4 PE5
PE6-WKUP3
V
LCD
PC13-RTC_AF1-WKUP2
PC14-OSC32_IN
PC15-OSC32_OUT
VSS_5
VDD_5
PH0-OSC_IN
PH1-OSC_OUT
NRST
PC0 PC1 PC2 PC3
VSSA
VREF-
VREF+
VDDA
PA 0- W K UP1
PA 1 PA 2
ai15692b
LQFP100

Figure 5. STM32L15xxx LQFP100 pinout

Doc ID 17659 Rev 6 27/109
Pin descriptions STM32L151xx, STM32L152xx
44 43 42 41 40 39 38 37
36
35
34
33 32 31 30 29 28 27 26 25
24
23
12
13 14 15 16 17 18 19 20 21 22
1 2 3 4 5 6 7 8 9 10 11
48 47 46 45
PA 3
PA 4
PA 5
PA 6
PA 7
PB0
PB1
PB2
PB10
PB11
VSS_1
VDD_1
VDD_2 VSS_2 PA1 3 PA1 2 PA1 1 PA1 0 PA9 PA8 PB15 PB14 PB13 PB12
V
LCD
PC13- RTC_AF1-WKUP2
PC14-OSC32_IN
PC15-OSC32_OUT
PH0-OSC_IN
PH1-OSC_OUT
NRST VSSA VDDA
PA 0 -W K UP1
PA 1 PA 2
VDD_3
VSS_3
PB9
PB8
BOOT0
PB7
PB6
PB5
PB4
PB3
PA1 5
PA 14
LQFP48
ai15694 b

Figure 6. STM32L15xxx LQFP64 pinout

VDD_3
VSS_3
PB9
PB8
BOOT0
PB7
PB6
PB5
PB4
PB3
PD2
PC12
PC11
PC10
PA 1 5
PA 14
V
PC13-RTC_AF1-WKUP2
LCD
PC14-OSC32_IN
PC15-OSC32_OUT
PH0 -OSC_IN
PH1- OSC_OUT
NRST
PC0 PC1 PC2 PC3
VSSA
VDDA
PA 0- W K UP1
PA 1 PA 2
64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 18 19 20 21 22 23 24 29 30 31 3225 26 27 28
PA 3
VSS_4
VDD_4
LQFP64
PA 4
PA 5
PA 6
PA 7
PB0
PB1
PC5
PB2
PB10
PB11
PC4
VDD_2
48
VSS_2
47
PA 1 3
46
PA 1 2
45
PA 1 1
44
PA 1 0
43
PA 9
42
PA 8
41
PC9
40
PC8
39
PC7
38
PC6
37
PB15
36
PB14
35
PB13
34
33
PB12
VSS_1
VDD_1
ai15693b

Figure 7. STM32L15xxx LQFP48 pinout

28/109 Doc ID 17659 Rev 6
STM32L151xx, STM32L152xx Pin descriptions
6
33?
"//4
0"
0"
0"
0"
0"
0!
0!
        

6
$$?

6
33?

0!
5&1&0.

0!
6
33!
 0!
6
$$!

0!
0!7+50

0! 
0! 

0! 
0! 

6
$$?
        
0! 
0! 
0! 
0! 
0! 
0"
0"
0"
6
33?
AIC






  
  
0"
0"
0"
0"
0"
0"
6
,#$
0#24#?!&
0#/3#?).
0#/3#?/54
0(/3#?).
0(/3#?/54
.234
0"
0"
6
$$?

Figure 8. STM32L15xxx UFQFPN48 pinout

Doc ID 17659 Rev 6 29/109
Pin descriptions STM32L151xx, STM32L152xx

Table 4. STM32L15xxx pin definitions

Pins
(2)
Main
function
(after reset)
I/O Level
(3)
Alternate functions
LQFP100
LQFP64
TFBGA64
Pin name
(1)
Type
UFBGA100
LQFP48 or UFQFPN48
1 - B2 - PE2 I/O FT PE2 TRACECK/LCD_SEG38/TIM3_ETR
2 - A1 - PE3 I/O FT PE3 TRACED0/LCD_SEG39/TIM3_CH1
3 - B1 - PE4 I/O FT PE4 TRACED1/TIM3_CH2
4 - C2 - PE5 I/O FT PE5 TRACED2/TIM9_CH1
5 - D2 - PE6 I/O FT PE6 TRACED3/WKUP3/TIM9_CH2
6 1 B2 E2 1 V
72A2C1 2
83A1D1 3
OSC32_IN
(4)
LCD
PC13-
RTC_AF1
PC14-
SV
LCD
I/O FT PC13 RTC_AF1/WKUP2
I/O PC14 OSC32_IN
(5)
PC15-
9 4 B1 E1 4
OSC32_OUT
(5)
I/O PC15 OSC32_OUT
10 - - F2 - V
11 - - G2 - V
12 5 C1 F1 5
13 6 D1 G1 6
OSC_IN
OSC_OUT
SS_5
DD_5
PH0-
PH1-
SV
SV
I PH0 OSC_IN
(6)
SS_5
DD_5
O PH1 OSC_OUT
14 7 E1 H2 7 NRST I/O NRST
15 8 E3 H1 - PC0 I/O FT PC0 ADC_IN10/LCD_SEG18/ COMP1_INP
16 9 E2 J2 - PC1 I/O FT PC1 ADC_IN11/LCD_SEG19/ COMP1_INP
17 10 F2 J3 - PC2 I/O FT PC2 ADC_IN12/LCD_SEG20/ COMP1_INP
(7)
18 11 -
19 12 F1 J1 8 V
20 - - K1 - V
21 -
22 13 H1 M1 9 V
23 14 G2 L2 10 PA0-WKUP1 I/O FT PA0
K2 - PC3 I/O PC3 ADC_IN13/LCD_SEG21/ COMP1_INP
SV
SV
SV
SV
SSA
REF-
REF+
DDA
G1
L1 - V
(7)
SSA
REF-
REF+
DDA
WKUP1/USART2_CTS/ADC_IN0/TIM2_CH1_ETR/
COMP1_INP
30/109 Doc ID 17659 Rev 6
Loading...
+ 79 hidden pages