STM32F10x参考手册 第一版
STM32F10x 参考手册
STM32F10x参考手册 第一版 目录
1 文档中的约定................................................................................................................................1
1.1 寄存器描述中使用的缩写列表 ........................................................................................1
2 存储器和总线构架.........................................................................................................................2
2.1 系统构架.........................................................................................................................2
2.2 存储器组织 .....................................................................................................................3
2.3 存储器映像 .....................................................................................................................4
2.3.1 外设存储器映像.......................................................................................................5
2.3.2 嵌入式SRAM...........................................................................................................6
2.3.3 位段.........................................................................................................................6
2.3.4 嵌入式闪存..............................................................................................................6
2.4 启动配置.........................................................................................................................8
3 电源控制(PWR) ............................................................................................................................9
3.1 电源................................................................................................................................9
3.1.1 独立的A/D转换器供电和参考电压 ...........................................................................9
3.1.2 电池备份 .................................................................................................................9
3.1.3 电压调节器............................................................................................................10
3.2 电源管理器 ...................................................................................................................10
3.2.1 上电复位(POR)和掉电复位(PDR)..........................................................................10
3.2.2 可编程电压监测器(PVD) .......................................................................................10
3.3 低功耗模式 ................................................................................................................... 11
3.3.1 降低系统时钟 ........................................................................................................12
3.3.2 外部时钟的控制.....................................................................................................12
3.3.3 睡眠模式 ...............................................................................................................12
3.3.4 停止模式 ...............................................................................................................13
3.3.5 待机模式 ...............................................................................................................14
3.3.6 低功耗模式下的自动唤醒(AWU)............................................................................15
3.4 电源控制寄存器............................................................................................................16
3.4.1 电源控制寄存器(PWR_CR)...................................................................................16
3.4.2 电源控制/状态寄存器.............................................................................................17
3.5 PWR寄存器映像...........................................................................................................18
4 复位和时钟控制 ..........................................................................................................................19
4.1 复位..............................................................................................................................19
4.1.1 系统复位 ...............................................................................................................19
4.1.2 电源复位 ...............................................................................................................19
STM32F10x参考手册 第一版 目录
4.1.3 备份域复位............................................................................................................20
4.2 时钟..............................................................................................................................20
4.2.1 HSE时钟 ...............................................................................................................22
4.2.2 HSI时钟.................................................................................................................22
4.2.3 PLL .......................................................................................................................23
4.2.4 LSE时钟................................................................................................................23
4.2.5 LSI时钟 .................................................................................................................23
4.2.6 系统时钟(SYSCLK)选择........................................................................................24
4.2.7 时钟安全系统(CSS)...............................................................................................24
4.2.8 RTC时钟 ...............................................................................................................24
4.2.9 看门狗时钟............................................................................................................24
4.2.10 时钟输出 ...............................................................................................................25
4.3 RCC寄存器描述 ...........................................................................................................26
4.3.1 时钟控制寄存器(RCC_CR) ...................................................................................26
4.3.2 时钟配置寄存器(RCC_CFGR)...............................................................................27
4.3.3 时钟中断寄存器 (RCC_CIR)..................................................................................29
4.3.4 APB2外设复位寄存器 (RCC_APB2RSTR)............................................................32
4.3.5 APB1外设复位寄存器 (RCC_APB1RSTR)............................................................33
4.3.6 AHB外设时钟使能寄存器 (RCC_AHBENR) ..........................................................35
4.3.7 APB2外设时钟使能寄存器(RCC_APB2ENR)........................................................36
4.3.8 APB1外设时钟使能寄存器(RCC_APB1ENR)........................................................37
4.3.9 备份域控制寄存器 (RCC_BDCR) ..........................................................................39
4.3.10 控制/状态寄存器 (RCC_CSR) ...............................................................................40
4.4 RCC寄存器映像 ...........................................................................................................43
5 通用和复用功能I/O(GPIO和AFIO) ..............................................................................................44
5.1 GPIO功能描述..............................................................................................................44
5.1.1 通用I/O(GPIO).......................................................................................................45
5.1.2 单独的位设置或位清除 ..........................................................................................45
5.1.3 外部中断/唤醒线....................................................................................................46
5.1.4 复用功能(AF).........................................................................................................46
5.1.5 软件重新映射I/O复用功能 .....................................................................................46
5.1.6 GPIO锁定机制.......................................................................................................46
5.1.7 输入配置 ...............................................................................................................46
5.1.8 输出配置 ...............................................................................................................47
5.1.9 复用功能配置 ........................................................................................................48
STM32F10x参考手册 第一版 目录
5.1.10 模拟输入配置 ........................................................................................................49
5.2 GPIO寄存器描述 ..........................................................................................................50
5.2.1 端口配置低寄存器(GPIOx_CRL) (x=A..E) .............................................................50
5.2.2 端口配置高寄存器(GPIOx_CRH) (x=A..E) ............................................................51
5.2.3 端口输入数据寄存器(GPIOx_IDR) (x=A..E) ..........................................................52
5.2.4 端口输出数据寄存器(GPIOx_ODR) (x=A..E).........................................................52
5.2.5 端口位设置/复位寄存器(GPIOx_BSRR) (x=A..E) ..................................................53
5.2.6 端口位复位寄存器(GPIOx_BRR) (x=A..E).............................................................53
5.2.7 端口配置锁定寄存器(GPIOx_LCKR) (x=A..E) .......................................................54
5.3 复用功能I/O和调试配置(AFIO) .....................................................................................55
5.3.1 把OSC_IN/OSC_OUT引脚作为GPIO端口PD0/PD1 .............................................55
5.3.2 BXCAN复用功能重映射 ........................................................................................55
5.3.3 JTAG/SWD复用功能重映射...................................................................................55
5.3.4 定时器复用功能重映射 ..........................................................................................56
5.3.5 USART复用功能重映射.........................................................................................57
5.3.6 I2C 1 复用功能重映射 ...........................................................................................58
5.3.7 SPI 1复用功能重映射 ............................................................................................58
5.4 AFIO寄存器描述...........................................................................................................59
5.4.1 复用重映射和调试I/O配置寄存器(AFIO_MAPR)....................................................60
5.4.2 外部中断配置寄存器1(AFIO_EXTICR1)................................................................62
5.4.3 外部中断配置寄存器2(AFIO_EXTICR2)................................................................62
5.4.4 外部中断配置寄存器3(AFIO_EXTICR3)................................................................63
5.4.5 外部中断配置寄存器4(AFIO_EXTICR4)................................................................63
5.5 GPIO 和AFIO寄存器地址映象 ......................................................................................64
5.5.1 GPIO寄存器地址映象............................................................................................64
5.5.2 AFIO寄存器地址映象 ............................................................................................65
6 中断和事件 .................................................................................................................................66
6.1 嵌套向量中断控制器(NVIC) .....................................................................................66
6.1.1 系统嘀嗒(SysTick)校准值寄存器 ...........................................................................66
6.1.2 中断和异常向量.....................................................................................................66
6.2 外部中断/事件控制器(EXTI) .........................................................................................68
6.2.1 主要特性 ...............................................................................................................68
6.2.2 框图.......................................................................................................................69
6.2.3 唤醒事件管理 ........................................................................................................69
6.2.4 功能说明 ...............................................................................................................69
STM32F10x参考手册 第一版 目录
6.2.5 外部中断/事件线路映像 .........................................................................................71
6.3 EXTI 寄存器描述 ..........................................................................................................72
6.3.1 外部中断/事件寄存器映像 .....................................................................................75
7 DMA 控制器(DMA) ................................................................................................................76
7.1 简介..............................................................................................................................76
7.2 主要特性.......................................................................................................................76
7.3 功能描述.......................................................................................................................77
7.3.1 DMA处理...............................................................................................................77
7.3.2 仲裁器 ...................................................................................................................77
7.3.3 DMA 通道..............................................................................................................78
7.3.4 错误管理 ...............................................................................................................79
7.3.5 DMA请求映像........................................................................................................79
7.4 DMA寄存器 ..................................................................................................................82
7.4.1 DMA中断状态寄存器(DMA_ISR)...........................................................................82
7.4.2 DMA中断标志清除寄存器(DMA_IFCR) .................................................................82
7.4.3 DMA通道x配置寄存器(DMA_CCRx)(x = 1…7) .....................................................83
7.4.4 DMA通道x传输数量寄存器(DMA_CNDTRx)(x = 1…7)..........................................85
7.4.5 DMA通道x外设地址寄存器(DMA_CPARx)(x = 1…7) ............................................85
7.4.6 DMA通道x存储器地址寄存器(DMA_CPARx)(x = 1…7).........................................85
7.5 DMA寄存器映像 ...........................................................................................................86
8 实时时钟(RTC) ......................................................................................................................88
8.1 简介..............................................................................................................................88
8.2 主要特性.......................................................................................................................88
8.3 功能描述.......................................................................................................................88
8.3.1 概述.......................................................................................................................88
8.3.2 复位过程 ...............................................................................................................90
8.3.3 读RTC寄存器 ........................................................................................................90
8.3.4 配置RTC寄存器.....................................................................................................90
8.3.5 RTC标志的设置.....................................................................................................90
8.4 RTC寄存器描述............................................................................................................91
8.4.1 RTC控制寄存器高位(RTC_CRH) .....................................................................91
8.4.2 RTC控制寄存器低位(RTC_CRL)......................................................................92
8.4.3 RTC预分频装载寄存器(RTC_PRLH/RTC_PRLL).............................................93
8.4.4 RTC预分频分频因子寄存器(RTC_DIVH / RTC_DIVL) ..........................................94
8.4.5 RTC计数器寄存器 (RTC_CNTH / RTC_CNTL) .....................................................95
- 1
- 2
前往页