首页 星云 工具 资源 星选 资讯 热门工具
:

PDF转图片 完全免费 小红书视频下载 无水印 抖音视频下载 无水印 数字星空

STMS003F3的TIM1和TIM2定时器,ADC采样与普通IO输入输出配置(新手必看,保姆级)

硬件开发 9.69MB 9 需要积分: 1
立即下载

资源介绍:

STMS003F3的TIM1和TIM2定时器,ADC采样与普通IO输入输出配置(新手必看,保姆级)
October 2017 DocID14587 Rev 14 1/467
1
RM0016
Reference manual
STM8S Series and STM8AF Series 8-bit microcontrollers
Introduction
This reference manual provides complete information for application developers on how to
use STM8S Series and STM8AF Series microcontroller memory and peripherals.
The STM8AF Series of microcontrollers is designed for automotive applications, with
different memory densities, packages and peripherals:
The low-density STM8AF devices are the STM8AF6223/26 with 8 Kbytes of Flash
memory.
The medium-density STM8AF devices are the STM8AF624x and STM8AF6266/68
microcontrollers with 16 to 32 Kbytes of Flash memory.
The high-density STM8AF devices are the STM8AF52xx and STM8AF6269/8x/Ax
microcontrollers with 32 to 128 Kbytes of Flash memory.
The STM8S Series of microcontrollers is designed for general purpose applications, with
different memory densities, packages and peripherals.
The value-line low-density STM8S devices are the STM8S001xx/STM8S003xx
microcontrollers with 8 Kbytes of Flash memory.
The value-line medium-density STM8S devices are the STM8S005xx microcontrollers
with 32 Kbytes of Flash memory.
The value-line high-density STM8S devices are the STM8S007xx microcontrollers with
64 Kbytes of Flash memory.
The access-line low-density STM8S devices are the STM8S103xx and STM8S903xx
microcontrollers with 8 Kbytes of Flash memory.
The access-line medium-density STM8S devices are the STM8S105xx microcontrollers
with 16 to 32 Kbytes of Flash memory.
The performance-line high-density STM8S devices are the STM8S207xx and
STM8S208xx microcontrollers with 32 to 128 Kbytes of Flash memory.
Refer to the product datasheet for ordering information, pin description, mechanical and
electrical device characteristics, and for the complete list of available peripherals.
Reference documents
For information on programming, erasing and protection of the internal Flash memory
please refer to the STM8S Series and STM8AF Series Flash programming manual
(PM0051), and to the STM8 SWIM communication protocol and debug module user
manual (UM0470).
For information on the STM8 core, refer to STM8 CPU programming manual (PM0044).
The bootloader user manual (UM0560) describes the usage of the integrated ROM
bootloader.
www.st.com
Contents RM0016
2/467 DocID14587 Rev 14
Contents
1 Central processing unit (CPU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.1 CPU introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.2 CPU registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.2.1 Description of CPU registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.2.2 STM8 CPU register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.3 Global configuration register (CFG_GCR) . . . . . . . . . . . . . . . . . . . . . . . . 27
1.3.1 Activation level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.3.2 SWIM disable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.3.3 Description of global configuration register (CFG_GCR) . . . . . . . . . . . . 28
1.3.4 Global configuration register map and reset values . . . . . . . . . . . . . . . 28
2 Boot ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3 Memory and register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.1 Memory layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.1.1 Memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.1.2 Stack handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.2 Register description abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4 Flash program memory and data EEPROM . . . . . . . . . . . . . . . . . . . . . 34
4.1 Flash and EEPROM introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.2 Flash and EEPROM glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.3 Main Flash memory features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.4 Memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.4.1 STM8S and STM8AF memory organization . . . . . . . . . . . . . . . . . . . . . 36
4.4.2 Memory access/ wait state configuration . . . . . . . . . . . . . . . . . . . . . . . . 40
4.4.3 User boot area (UBC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.4.4 Data EEPROM (DATA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.4.5 Main program area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.4.6 Option bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.5 Memory protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
4.5.1 Readout protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
4.5.2 Memory access security system (MASS) . . . . . . . . . . . . . . . . . . . . . . . 44
DocID14587 Rev 14 3/467
RM0016 Contents
16
4.5.3 Enabling write access to option bytes . . . . . . . . . . . . . . . . . . . . . . . . . . 45
4.6 Memory programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
4.6.1 Read-while-write (RWW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
4.6.2 Byte programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
4.6.3 Word programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.6.4 Block programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.6.5 Option byte programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.7 ICP (in-circuit programming) and IAP (in-application programming) . . . . 49
4.8 Flash registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.8.1 Flash control register 1 (FLASH_CR1) . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.8.2 Flash control register 2 (FLASH_CR2) . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.8.3 Flash complementary control register 2 (FLASH_NCR2) . . . . . . . . . . . 53
4.8.4 Flash protection register (FLASH_FPR) . . . . . . . . . . . . . . . . . . . . . . . . 54
4.8.5 Flash protection register (FLASH_NFPR) . . . . . . . . . . . . . . . . . . . . . . . 54
4.8.6 Flash program memory unprotecting key register (FLASH_PUKR) . . . 54
4.8.7 Data EEPROM unprotection key register (FLASH_DUKR) . . . . . . . . . . 55
4.8.8 Flash status register (FLASH_IAPSR) . . . . . . . . . . . . . . . . . . . . . . . . . . 55
4.8.9 Flash register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5 Single wire interface module (SWIM) and debug module (DM) . . . . . 57
5.1 SWIM and DM introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.2 SWIM main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5.3 SWIM modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6 Interrupt controller (ITC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.1 ITC introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.2 Interrupt masking and processing flow . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.2.1 Servicing pending interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.2.2 Interrupt sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
6.3 Interrupts and low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.4 Activation level/low power mode control . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.5 Concurrent and nested interrupt management . . . . . . . . . . . . . . . . . . . . . 64
6.5.1 Concurrent interrupt management mode . . . . . . . . . . . . . . . . . . . . . . . . 64
6.5.2 Nested interrupt management mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
6.6 External interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.7 Interrupt instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Contents RM0016
4/467 DocID14587 Rev 14
6.8 Interrupt mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
6.9 ITC and EXTI registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
6.9.1 CPU condition code register interrupt bits (CCR) . . . . . . . . . . . . . . . . . 68
6.9.2 Software priority register x (ITC_SPRx) . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.9.3 External interrupt control register 1 (EXTI_CR1) . . . . . . . . . . . . . . . . . . 70
6.9.4 External interrupt control register 1 (EXTI_CR2) . . . . . . . . . . . . . . . . . . 71
6.9.5 ITC and EXTI register map and reset values . . . . . . . . . . . . . . . . . . . . . 72
7 Power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
8 Reset (RST) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
8.1 “Reset state” and “under reset” definitions . . . . . . . . . . . . . . . . . . . . . . . . 74
8.2 Reset circuit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
8.3 Internal reset sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
8.3.1 Power-on reset (POR) and brown-out reset (BOR) . . . . . . . . . . . . . . . . 75
8.3.2 Watchdog reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
8.3.3 Software reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
8.3.4 SWIM reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
8.3.5 Illegal opcode reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
8.3.6 EMC reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
8.4 RST register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
8.4.1 Reset status register (RST_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
8.5 RST register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
9 Clock control (CLK) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
9.1 Master clock sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
9.1.1 HSE (high-speed external) clock signal . . . . . . . . . . . . . . . . . . . . . . . . . 80
9.1.2 HSI (high-speed internal) clock signal . . . . . . . . . . . . . . . . . . . . . . . . . . 81
9.1.3 LSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
9.2 Master clock switching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
9.2.1 System startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
9.2.2 Master clock switching procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
9.3 Low-speed clock selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
9.4 CPU clock-divider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
9.5 Peripheral clock-gating (PCG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
9.6 Clock security system (CSS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
DocID14587 Rev 14 5/467
RM0016 Contents
16
9.7 Clock-out capability (CCO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
9.8 CLK interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
9.9 CLK register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
9.9.1 Internal clock register (CLK_ICKR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
9.9.2 External clock register (CLK_ECKR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
9.9.3 Clock master status register (CLK_CMSR) . . . . . . . . . . . . . . . . . . . . . . 92
9.9.4 Clock master switch register (CLK_SWR) . . . . . . . . . . . . . . . . . . . . . . . 92
9.9.5 Switch control register (CLK_SWCR) . . . . . . . . . . . . . . . . . . . . . . . . . . 93
9.9.6 Clock divider register (CLK_CKDIVR) . . . . . . . . . . . . . . . . . . . . . . . . . . 94
9.9.7 Peripheral clock gating register 1 (CLK_PCKENR1) . . . . . . . . . . . . . . . 95
9.9.8 Peripheral clock gating register 2 (CLK_PCKENR2) . . . . . . . . . . . . . . . 96
9.9.9 Clock security system register (CLK_CSSR) . . . . . . . . . . . . . . . . . . . . . 97
9.9.10 Configurable clock output register (CLK_CCOR) . . . . . . . . . . . . . . . . . 98
9.9.11 HSI clock calibration trimming register (CLK_HSITRIMR) . . . . . . . . . . . 99
9.9.12 SWIM clock control register (CLK_SWIMCCR) . . . . . . . . . . . . . . . . . . . 99
9.10 CLK register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
10 Power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
10.1 General considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
10.1.1 Clock management for low consumption . . . . . . . . . . . . . . . . . . . . . . . 102
10.2 Low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
10.2.1 Wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
10.2.2 Halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
10.2.3 Active-halt modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
10.3 Additional analog power controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
10.3.1 Fast Flash wakeup from Halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
10.3.2 Very low Flash consumption in Active-halt mode . . . . . . . . . . . . . . . . . 104
11 General purpose I/O ports (GPIO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
11.2 GPIO main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
11.3 Port configuration and usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
11.3.1 Input modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
11.3.2 Output modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
11.4 Reset configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
11.5 Unused I/O pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

资源文件列表:

中英文寄存器手册说明.zip 大约有2个文件
  1. 中英文寄存器手册说明/STM8S_参考手册_CH_V4中文.pdf 4.34MB
  2. 中英文寄存器手册说明/STM8S003F寄存器配置说明英文.pdf 9.48MB
0评论
提交 加载更多评论
其他资源 中文简体繁体转换工具,支持txt,小说格式
普通转换 可以直接将字幕文件拖拽到软件中,自动读取字幕文件内容,点击“转为简体”或“转为繁体”完成转换,点击“保存”按钮可以输出保存。 批量转换 可以直接将含有字幕的文件夹拖拽到软件中,选择转换的格式,填写输出的文件名样式,点击“开始转换”即可完成转换。 批量转换使用多线程技术,转换过程UI不卡顿,其他功能可正常同步使用,方便并快捷。 需要注意当目标“文件名”与源文件或已存在文件同名时会覆盖掉已有文件,请注意备份源字幕文件。 批量转换将自动获取该目录下的全部字幕文件(包括ASS、SSA、SRT、LRC、TXT),其他格式文件不会读取。 输入编码说明 此功能针对BIG5或GBK等编码的文件输出乱码的问题,通过修改对应的输入文件编码,解决乱码的问题。 默认建议使用UTF-8,适用大多数的输入文件。 输出编码说明 无特殊要求不要修改此选项,选择错误将导致输出文件乱码。 默认建议使用UTF-8,适用大多数视频播放器。 文件名样式说明 批量转换使用的是文件名样式替换掉替换符,替换符使用{}包裹,已有替换符如下: {name} 源文件名 如果觉得可以的话可以给个赞吗,拜托拜托
content_1723521037584.zip
content_1723521037584.zip
Android Launcher应用开发
Android Launcher应用开发Android Launcher应用开发
萝丽-三代控及接收机源代码
简单易用
backup-script 安卓手机 应用程序app数据备份恢复
备份/恢复应用数据,支持设备:Android 8++arm64 数据完整:在更换系统之后,原有的数据全部保留,无需重新登录或者下载额外的数据包。 易操作:简单几步即可备份应用完整数据! 限制少:不限制机型,可跨安卓版本。 功能强:可备份恢复split apk 算法多:目前支持的压缩算法有 tar(默认) lz4 zstd。 速度快:即使使用zstd压缩算法速率依旧快速。 1. 已经root的安卓手机,安装mt文件管理器, 2. 将该zip解压到手机人意目录,可以看到,生成應用列表.sh,backup_settings.conf,備份應用.sh,tools,備份自定義資料夾.sh,終止腳本.sh 3.然后执行生成應用列表.sh腳本,並等待脚本输出显示,再等待提示结束,此时会在当前目录生成一个appList.txt,这个就是当前手机安装的应用程序app列表。 4. 然后打开生成的appList.txt,根据提示操作后保存 5. 找到backup_settings.conf,再打開備份應用.sh,等候备份结束。完成后在会在当前目录以Backup_压缩算法名 命名的文件夹是备份
虚幻引擎中文七千字体包
虚幻引擎中文7k字随便下
Git-BashGit-BashGit-BashGit-BashGit-Bash
Git-BashGit-BashGit-Bash
ubuntu20.04使用C++与ONNXRuntime对yolov8目标检测模型进行推理预测(源码)
ubuntu20.04使用C++与ONNXRuntime对yolov8目标检测模型进行推理预测(源码)