没有合适的资源?快使用搜索试试~ 我知道了~
首页STM32L152寄存器手册
STM32L152寄存器手册
3星 · 超过75%的资源 需积分: 10 43 下载量 158 浏览量
更新于2023-03-16
评论
收藏 12.99MB PDF 举报
STM32L152寄存器手册,基本上很全面。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
资源详情
资源评论
资源推荐
September 2017 DocID15965 Rev 15 1/911
1
RM0038
Reference manual
STM32L100xx, STM32L151xx, STM32L152xx and STM32L162xx
advanced ARM
®
-based 32-bit MCUs
Introduction
This reference manual targets application developers. It provides complete information on
how to use the STM32L151xx, STM32L152xx and STM32L162xx and STM32L100xx
microcontroller memory and peripherals. The STM32L151xx, STM32L152xx and
STM32L162xx and STM32L100xx value line will be referred to as STM32L1xxxx throughout
the document, unless otherwise specified.
The STM32L1xxxx is a family of microcontrollers with different memory sizes, packages and
peripherals.
For ordering information, mechanical and electrical device characteristics, refer to the
corresponding datasheets.
For information on programming, erasing and protection of the internal non volatile memory,
refer to
Section 3: Flash program memory and data EEPROM (FLASH).
For information on the ARM
®
Cortex
®
-M3 core, refer to the Cortex
®
-M3 Technic al
Reference Manual.
Related documents
Available from www.arm.com:
• Cortex
®
-M3 Technical Reference Manual, available from http://infocenter.arm.com
Available from www.st.com:
• STM32L151xx STM32L152xx datasheets
• STM32L162xx datasheet
• STM32L100xx datasheet
• STM32F10xxx/20xxx/21xxx/L1xxxx Cortex
®
-M3 programming manual
• Migrating from STM32L15xx6/8/B to STM32L15xx6/8/B-A and from STM32L100x6/8/B to
STM32L100x6/8/B-A (TN1176)
• Migrating from STM32L15/6xRC-A to STM32L15/6xRC and from STM32L15/6xVC-A to
STM32L15/6xVC (TN1177)
• Migrating from STM32L15/6xxD to STM32L15/6xxE (TN1178)
• Migrating from STM32L15/6xxD to STM32L15/6xVD-X (TN1201)
www.st.com
Contents RM0038
2/911 DocID15965 Rev 15
Contents
1 Documentation conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
1.1 List of abbreviations for registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
1.2 Peripheral availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
1.3 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
1.4 Product category definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2 System architecture and memory overview . . . . . . . . . . . . . . . . . . . . . 42
2.1 System architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.2 Memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.3 Memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.4 Embedded SRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.5 NVM overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.6 Bit banding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.7 Boot configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3 Flash program memory and data EEPROM (FLASH) . . . . . . . . . . . . . . 52
3.1 NVM introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.2 NVM organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.3 Read interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.3.1 Relation between CPU clock frequency and Flash memory read time . 59
3.3.2 Instruction prefetch when Flash access is 64 bits . . . . . . . . . . . . . . . . . 60
3.3.3 Data management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.4 Memory operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.4.1 Unlocking/locking memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.4.2 Erasing memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.4.3 Programming memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.4.4 Read while write (RWW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
3.5 Option byte description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.5.1 Option byte block programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
3.6 Quick reference to programming/erase functions . . . . . . . . . . . . . . . . . . 77
3.7 Memory protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
3.7.1 Readout protection (RDP) of the program and data EEPROMs . . . . . . 80
DocID15965 Rev 15 3/911
RM0038 Contents
26
3.7.2 Write protection (WRP) of the program memory . . . . . . . . . . . . . . . . . . 82
3.7.3 Write protection error flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
3.7.4 PCROP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
3.8 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
3.9 Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
3.9.1 Access control register (FLASH_ACR) . . . . . . . . . . . . . . . . . . . . . . . . . 83
3.9.2 Program/erase control register (FLASH_PECR) . . . . . . . . . . . . . . . . . . 84
3.9.3 Power down key register (FLASH_PDKEYR) . . . . . . . . . . . . . . . . . . . . 87
3.9.4 Program/erase key register (FLASH_PEKEYR) . . . . . . . . . . . . . . . . . . 87
3.9.5 Program memory key register (FLASH_PRGKEYR) . . . . . . . . . . . . . . . 87
3.9.6 Option byte key register (FLASH_OPTKEYR) . . . . . . . . . . . . . . . . . . . . 88
3.9.7 Status register (FLASH_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
3.9.8 Option byte register (FLASH_OBR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
3.9.9 Write protection register (FLASH_WRPRx) . . . . . . . . . . . . . . . . . . . . . . 91
3.9.10 Register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
4 CRC calculation unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
4.1 CRC introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
4.2 CRC main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
4.3 CRC functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
4.4 CRC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
4.4.1 Data register (CRC_DR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
4.4.2 Independent data register (CRC_IDR) . . . . . . . . . . . . . . . . . . . . . . . . . 95
4.4.3 Control register (CRC_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
4.4.4 CRC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
5 Power control (PWR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
5.1 Power supplies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
5.1.1 Independent A/D and DAC converter supply and reference voltage . . . 99
5.1.2 Independent LCD supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
5.1.3 RTC and RTC backup registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
5.1.4 Voltage regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
5.1.5 Dynamic voltage scaling management . . . . . . . . . . . . . . . . . . . . . . . . 101
5.1.6 Dynamic voltage scaling configuration . . . . . . . . . . . . . . . . . . . . . . . . 103
5.1.7 Voltage regulator and clock management when VDD drops
below 2.0 V . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Contents RM0038
4/911 DocID15965 Rev 15
5.1.8 Voltage regulator and clock management when modifying the
VCORE range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
5.2 Power supply supervisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
5.2.1 Power on reset (POR)/power down reset (PDR) . . . . . . . . . . . . . . . . . 106
5.2.2 Brown out reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
5.2.3 Programmable voltage detector (PVD) . . . . . . . . . . . . . . . . . . . . . . . . 108
5.2.4 Internal voltage reference (VREFINT) . . . . . . . . . . . . . . . . . . . . . . . . . 109
5.3 Low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
5.3.1 Behavior of clocks in low-power modes . . . . . . . . . . . . . . . . . . . . . . . . 110
5.3.2 Slowing down system clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
5.3.3 Peripheral clock gating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
5.3.4 Low-power run mode (LP run) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
5.3.5 Sleep mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
5.3.6 Low-power sleep mode (LP sleep) . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
5.3.7 Stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
5.3.8 Standby mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
5.3.9 Waking up the device from Stop and Standby modes using the RTC
and comparators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
5.4 Power control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
5.4.1 PWR power control register (PWR_CR) . . . . . . . . . . . . . . . . . . . . . . . 121
5.4.2 PWR power control/status register (PWR_CSR) . . . . . . . . . . . . . . . . . 124
5.4.3 PWR register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
6 Reset and clock control (RCC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
6.1 Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
6.1.1 System reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
6.1.2 Power reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
6.1.3 RTC and backup registers reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
6.2 Clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
6.2.1 HSE clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
6.2.2 HSI clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
6.2.3 MSI clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
6.2.4 PLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
6.2.5 LSE clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
6.2.6 LSI clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
6.2.7 System clock (SYSCLK) selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
6.2.8 System clock source frequency versus voltage range . . . . . . . . . . . . . 135
DocID15965 Rev 15 5/911
RM0038 Contents
26
6.2.9 Clock security system (CSS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
6.2.10 Clock Security System on LSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
6.2.11 RTC and LCD clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
6.2.12 Watchdog clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
6.2.13 Clock-out capability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
6.2.14 Internal/external clock measurement with TIM9/TIM10/TIM11 . . . . . . 137
6.2.15 Clock-independent system clock sources for TIM9/TIM10/TIM11 . . . . 139
6.3 RCC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
6.3.1 Clock control register (RCC_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
6.3.2 Internal clock sources calibration register (RCC_ICSCR) . . . . . . . . . . 142
6.3.3 Clock configuration register (RCC_CFGR) . . . . . . . . . . . . . . . . . . . . . 142
6.3.4 Clock interrupt register (RCC_CIR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
6.3.5 AHB peripheral reset register (RCC_AHBRSTR) . . . . . . . . . . . . . . . . 148
6.3.6 APB2 peripheral reset register (RCC_APB2RSTR) . . . . . . . . . . . . . . 150
6.3.7 APB1 peripheral reset register (RCC_APB1RSTR) . . . . . . . . . . . . . . 151
6.3.8 AHB peripheral clock enable register (RCC_AHBENR) . . . . . . . . . . . 154
6.3.9 APB2 peripheral clock enable register (RCC_APB2ENR) . . . . . . . . . . 156
6.3.10 APB1 peripheral clock enable register (RCC_APB1ENR) . . . . . . . . . . 158
6.3.11 AHB peripheral clock enable in low-power mode register
(RCC_AHBLPENR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
6.3.12 APB2 peripheral clock enable in low-power mode register
(RCC_APB2LPENR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
6.3.13 APB1 peripheral clock enable in low-power mode register
(RCC_APB1LPENR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
6.3.14 Control/status register (RCC_CSR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
6.3.15 RCC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
7 General-purpose I/Os (GPIO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
7.1 GPIO introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
7.2 GPIO main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
7.3 GPIO functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
7.3.1 General-purpose I/O (GPIO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
7.3.2 I/O pin multiplexer and mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
7.3.3 I/O port control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
7.3.4 I/O port data registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
7.3.5 I/O data bitwise handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
7.3.6 GPIO locking mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
7.3.7 I/O alternate function input/output . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
剩余910页未读,继续阅读
xiao040238
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- RTL8188FU-Linux-v5.7.4.2-36687.20200602.tar(20765).gz
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
- SPC统计方法基础知识.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1