没有合适的资源?快使用搜索试试~ 我知道了~
首页STM8L101xx参考手册pdf
资源详情
资源评论
资源推荐
July 2010 Doc ID 14400 Rev 5 1/266
RM0013
Reference manual
STM8L101xx microcontroller family
Introduction
This reference manual targets application developers. It provides complete information on
how to use the STM8L101xx microcontroller memory and peripherals.
The STM8L is a family of microcontrollers with different memory densities, packages and
peripherals. The STM8L is designed for low power applications.
For ordering information, pin description, mechanical and electrical device characteristics,
please refer to the STM8L datasheets.
For information on the STM8 SWIM communication protocol and debug module, please refer
to the User Manual (UM0470).
For information on the STM8 core, please refer to the STM8 CPU Programming Manual
(PM0044).
www.st.com
Contents RM0013
2/266 Doc ID 14400 Rev 5
Contents
1 Memory and register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.1 Register description abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2 Central processing unit (CPU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.2 CPU registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.2.1 Description of CPU registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.2.2 STM8 CPU register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.3 Global configuration register (CFG_GCR) . . . . . . . . . . . . . . . . . . . . . . . . 22
2.3.1 Activation level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.3.2 SWIM disable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.3.3 Description of global configuration register (CFG_GCR) . . . . . . . . . . . . 23
2.3.4 Global configuration register map and reset values . . . . . . . . . . . . . . . . 23
3 Single wire interface module (SWIM) and debug module (DM) . . . . . 24
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.2 Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.3 SWIM modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4 Flash program memory and data EEPROM (Flash) . . . . . . . . . . . . . . . 25
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.2 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.3 Flash main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.4 Memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.4.1 User boot area (UBC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.4.2 Data EEPROM (DATA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.4.3 Main program area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.4.4 Option bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.5 Memory protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.5.1 Readout protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.5.2 Memory access security system (MASS) . . . . . . . . . . . . . . . . . . . . . . . 28
4.6 Memory programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.6.1 Byte programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
RM0013 Contents
Doc ID 14400 Rev 5 3/266
4.6.2 Word programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.6.3 Block programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.7 ICP and IAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.8 Flash registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.8.1 Flash control register 1 (FLASH_CR1) . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.8.2 Flash control register 2 (FLASH_CR2) . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.8.3 Flash program memory unprotecting key register (FLASH_PUKR) . . . 37
4.8.4 Data EEPROM unprotection key register (FLASH_DUKR) . . . . . . . . . . 37
4.8.5 Flash status register (FLASH_IAPSR) . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.8.6 Flash register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5 Interrupt controller (ITC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.1 ITC introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.2 Interrupt masking and processing flow . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.2.1 Servicing pending interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.2.2 Interrupt sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.3 Interrupts and low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.4 Activation level/low power mode control . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.5 Concurrent and nested interrupt management . . . . . . . . . . . . . . . . . . . . 44
5.5.1 Concurrent interrupt management mode . . . . . . . . . . . . . . . . . . . . . . . . 44
5.5.2 Nested interrupt management mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.6 External interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.7 Interrupt instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.8 Interrupt mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.9 ITC and EXTI registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.9.1 CPU condition code register interrupt bits (CCR) . . . . . . . . . . . . . . . . . 48
5.9.2 Software priority register x (ITC_SPRx) . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.9.3 External interrupt control register 1 (EXTI_CR1) . . . . . . . . . . . . . . . . . . 50
5.9.4 External interrupt control register 2 (EXTI_CR2) . . . . . . . . . . . . . . . . . . 51
5.9.5 External interrupt control register 3 (EXTI_CR3) . . . . . . . . . . . . . . . . . . 52
5.9.6 External interrupt status register 1 (EXTI_SR1) . . . . . . . . . . . . . . . . . . 53
5.9.7 External interrupt status register 2 (EXTI_SR2) . . . . . . . . . . . . . . . . . . 54
5.9.8 External interrupt port select register (EXTI_CONF) . . . . . . . . . . . . . . . 55
5.9.9 ITC and EXTI register map and reset values . . . . . . . . . . . . . . . . . . . . . 56
6 Power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Contents RM0013
4/266 Doc ID 14400 Rev 5
7 Reset (RST) and voltage detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
7.1 “Reset state” and “under reset” definitions . . . . . . . . . . . . . . . . . . . . . . . . 58
7.2 External reset (NRST pin) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
7.2.1 Asynchronous external reset description . . . . . . . . . . . . . . . . . . . . . . . . 58
7.2.2 Configuring NRST/PA1 pin as general purpose output . . . . . . . . . . . . . 59
7.3 Internal reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
7.3.1 Power-on reset (POR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
7.3.2 Independent watchdog reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
7.3.3 SWIM reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
7.3.4 Illegal opcode reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
7.4 RST registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
7.4.1 Reset pin configuration register (RST_CR) . . . . . . . . . . . . . . . . . . . . . . 60
7.4.2 Reset status register (RST_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
7.5 RST register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
8 Clock control (CLK) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
8.1 Master clock (HSI clock) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
8.1.1 Peripheral clock gating (PCG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
8.2 LSI clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
8.3 Configurable clock-output capability (CCO) . . . . . . . . . . . . . . . . . . . . . . . 64
8.4 CLK registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
8.4.1 Clock divider register (CLK_CKDIVR) . . . . . . . . . . . . . . . . . . . . . . . . . . 65
8.4.2 Peripheral clock gating register (CLK_PCKENR) . . . . . . . . . . . . . . . . . 65
8.4.3 Configurable clock output register (CLK_CCOR) . . . . . . . . . . . . . . . . . 66
8.4.4 CLK register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
9 Power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
9.1 General considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
9.2 Managing the clock for low consumption . . . . . . . . . . . . . . . . . . . . . . . . . 69
9.2.1 Slowing the system clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
9.2.2 Peripheral clock gating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
9.3 Switching peripherals off . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
9.3.1 Analog peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
9.3.2 Digital peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
9.4 Low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
9.4.1 Wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
RM0013 Contents
Doc ID 14400 Rev 5 5/266
9.4.2 Halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
9.4.3 Active-halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
9.5 WFE registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
9.5.1 WFE control register 1 (WFE_CR1) . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
9.5.2 WFE control register 2 (WFE_CR2) . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
9.6 WFE register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
10 General purpose I/O ports (GPIO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
10.2 GPIO main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
10.3 Port configuration and usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
10.3.1 Input modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
10.3.2 Output modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
10.4 Reset configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
10.5 Unused I/O pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
10.6 Low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
10.7 Input mode details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
10.7.1 Alternate function input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
10.7.2 Interrupt capability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
10.8 Output mode details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
10.8.1 Alternate function output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
10.8.2 Slope control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
10.9 GPIO registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
10.9.1 Port x output data register (Px_ODR) . . . . . . . . . . . . . . . . . . . . . . . . . . 81
10.9.2 Port x pin input register (Px_IDR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
10.9.3 Port x data direction register (Px_DDR) . . . . . . . . . . . . . . . . . . . . . . . . 82
10.9.4 Port x control register 1 (Px_CR1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
10.9.5 Port x control register 2 (Px_CR2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
10.9.6 GPIO register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
11 Auto-wakeup (AWU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
11.2 LSI clock measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
11.3 AWU functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
11.3.1 AWU operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
11.3.2 Time base selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
剩余265页未读,继续阅读
pioneerlong
- 粉丝: 5
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- ExcelVBA中的Range和Cells用法说明.pdf
- 基于单片机的电梯控制模型设计.doc
- 主成分分析和因子分析.pptx
- 共享笔记服务系统论文.doc
- 基于数据治理体系的数据中台实践分享.pptx
- 变压器的铭牌和额定值.pptx
- 计算机网络课程设计报告--用winsock设计Ping应用程序.doc
- 高电压技术课件:第03章 液体和固体介质的电气特性.pdf
- Oracle商务智能精华介绍.pptx
- 基于单片机的输液滴速控制系统设计文档.doc
- dw考试题 5套.pdf
- 学生档案管理系统详细设计说明书.doc
- 操作系统PPT课件.pptx
- 智慧路边停车管理系统方案.pptx
- 【企业内控系列】企业内部控制之人力资源管理控制(17页).doc
- 温度传感器分类与特点.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论10