Arm嵌入式系統原理及應用——STM32F103微控制器架構、編程與開發
李正軍
買這商品的人也買了...
-
$650$514 -
$450$405 -
$940$700 -
$780$616 -
$790$616 -
$590$460 -
$520$411 -
$580$452 -
$69$60 -
$68$68 -
$520$411 -
$880$748 -
$880$695 -
$599$509 -
$880$695 -
$400$360 -
$1,080$713 -
$599$569 -
$839$797 -
$450$351 -
$880$695 -
$408$388 -
$714$678 -
$594$564 -
$800$600
相關主題
商品描述
目錄大綱
第 1 章 緒論 ..................................................................................................................1
1.1 嵌入式系統 ..................................................................................................................1
1.1.1 嵌入式系統概述 ...............................................................................................2
1.1.2 嵌入式系統和通用電腦系統比較 ................................................................3
1.1.3 嵌入式系統的特點 ...........................................................................................4
1.2 嵌入式系統的組成 ......................................................................................................6
1.3 實時操作系統 ..............................................................................................................8
1.3.1 實時系統的概念 ...............................................................................................8
1.3.2 實時操作系統的基本特徵 ...............................................................................9
1.3.3 實時操作系統性能的衡量指標 ......................................................................10
1.3.4 實時操作系統的分類 .....................................................................................10
1.3.5 POSIX 標準 ................................................................................................... 11
1.3.6 實時操作系統的典型應用 .............................................................................12
1.4 嵌入式系統的軟件 ....................................................................................................12
1.4.1 無操作系統的嵌入式軟件 .............................................................................12
1.4.2 帶操作系統的嵌入式軟件 .............................................................................12
1.4.3 嵌入式操作系統的分類 .................................................................................13
1.4.4 嵌入式實時操作系統的功能 ..........................................................................14
1.4.5 典型的嵌入式操作系統 .................................................................................15
1.4.6 軟件架構選擇建議 .........................................................................................22
1.5 嵌入式系統的分類 ....................................................................................................22
1.5.1 按應用對象分類 .............................................................................................23
1.5.2 按功能和性能分類 .........................................................................................23
1.5.3 按結構復雜度分類 .........................................................................................23
1.6 嵌入式系統的應用領域 .............................................................................................24
1.7 嵌入式系統的體系 ....................................................................................................25
1.7.1 硬件架構 ........................................................................................................26
1.7.2 軟件層次 ........................................................................................................26
全書.indd 5 2024/3/7 15:46:49 VI Arm 嵌入式系統原理及應用——STM32F103 微控制器架構、編程與開發
1.8 嵌入式系統的設計方法 .............................................................................................29
1.8.1 嵌入式系統的總體結構 .................................................................................29
1.8.2 嵌入式系統設計流程 .....................................................................................30
1.8.3 嵌入式系統的軟/硬件協同設計技術 .............................................................32
第 2 章 嵌入式微處理器 ...............................................................................................34
2.1 Arm 嵌入式微處理器簡介 .........................................................................................34
2.1.1 Arm 處理器的特點 .........................................................................................34
2.1.2 Arm 體系結構的版本和系列..........................................................................35
2.1.3 Arm 的 RISC 結構特性 ..................................................................................38
2.1.4 Arm 處理器系列 ............................................................................................38
2.1.5 Arm Cortex-M 處理器 ....................................................................................41
2.2 嵌入式處理器的分類和特點 .....................................................................................42
2.3 Cortex-M3 嵌入式微處理器 ......................................................................................45
2.3.1 Arm 概述 ........................................................................................................45
2.3.2 CISC 和 RISC ................................................................................................48
2.3.3 Arm 架構的演變 ............................................................................................50
2.3.4 Arm 體系結構與特點 .....................................................................................52
2.3.5 Cortex-M 系列處理器 ....................................................................................54
2.3.6 Cortex-M3 處理器的主要特性 .......................................................................56
2.3.7 Cortex-M3 處理器結構 ..................................................................................57
2.3.8 存儲器系統 ....................................................................................................59
第 3 章 STM32 系列微控制器 ......................................................................................62
3.1 STM32 微控制器概述 ...............................................................................................62
3.1.1 STM32 微控制器產品介紹 ............................................................................63
3.1.2 STM32 系統性能分析 ....................................................................................67
3.1.3 STM32 微控制器的命名規則 ........................................................................68
3.1.4 STM32 微控制器的選型 ................................................................................72
3.2 STM32F1 系列產品系統架構和 STM32F103ZET6 內部架構 ..................................73
3.2.1 STM32F1 系列產品系統架構 ........................................................................74
3.2.2 STM32F103ZET6 內部架構 ..........................................................................76
3.3 STM32F103ZET6 的存儲器映像 ..............................................................................79
3.3.1 STM32F103ZET6 內置外設的地址範圍 ........................................................81
3.3.2 嵌入式 SRAM ................................................................................................82
全書.indd 6 2024/3/7 15:46:49 目錄 VII
3.3.3 嵌入式 Flash ..................................................................................................83
3.4 STM32F103ZET6 的時鐘結構 ..................................................................................84
3.5 STM32F103VET6 的引腳 .........................................................................................87
3.6 STM32F103VET6 最小系統設計 ..............................................................................92
第 4 章 嵌入式開發環境的搭建 ....................................................................................95
4.1 Keil MDK5 安裝配置 ................................................................................................95
4.1.1 Keil MDK 簡介 ..............................................................................................95
4.1.2 Keil MDK 下載 ..............................................................................................98
4.1.3 Keil MDK 安裝 ..............................................................................................99
4.1.4 安裝庫文件 ..................................................................................................101
4.2 Keil MDK 新工程的創建 ........................................................................................102
4.2.1 建立文件夾 ..................................................................................................102
4.2.2 打開 Keil μVision .........................................................................................102
4.2.3 新建工程 ......................................................................................................103
4.3 Cortex-M3 微控制器軟件接口標準 CMSIS ............................................................104
4.3.1 CMSIS 介紹 .................................................................................................105
4.3.2 STM32F10x 標準外設庫 ..............................................................................106
4.4 STM32F103 開發板的選擇 ..................................................................................... 110
4.5 STM32 模擬器的選擇 ............................................................................................. 110
第 5 章 STM32 中斷 .................................................................................................. 113
5.1 中斷概述 ................................................................................................................. 113
5.1.1 中斷 ............................................................................................................. 114
5.1.2 中斷的功能 .................................................................................................. 114
5.1.3 中斷源與中斷屏蔽 ....................................................................................... 115
5.1.4 中斷處理過程 .............................................................................................. 116
5.1.5 中斷優先級與中斷嵌套 ............................................................................... 118
5.2 STM32F1 中斷系統 ................................................................................................. 119
5.2.1 STM32F1 嵌套向量中斷控制器 .................................................................. 119
5.2.2 STM32F1 中斷優先級 .................................................................................120
5.2.3 STM32F1 中斷向量表 .................................................................................121
5.2.4 STM32F1 中斷服務函數 ..............................................................................124
5.3 STM32F1 外部中斷 / 事件控制器 EXTI .................................................................125
5.3.1 STM32F1 的 EXTI 內部結構 .......................................................................125
全書.indd 7 2024/3/7 15:46:49 VIII Arm 嵌入式系統原理及應用——STM32F103 微控制器架構、編程與開發
5.3.2 STM32F1 的 EXTI 工作原理 .......................................................................128
5.3.3 STM32F1 的 EXTI 主要特性 .......................................................................129
5.4 STM32F1 的中斷系統庫函數 ..................................................................................129
5.4.1 STM32F1 的 NVIC 相關庫函數 ..................................................................130
5.4.2 STM32F1 的 EXTI 相關庫函數 ...................................................................133
5.4.3 STM32F1 的 EXTI 中斷線 GPIO 引腳映射庫函數 .....................................137
5.5 STM32F1 外部中斷設計流程 ..................................................................................137
5.5.1 NVIC 設置 ...................................................................................................137
5.5.2 中斷埠配置 ..............................................................................................138
5.5.3 中斷處理 ......................................................................................................139
5.6 STM32F1 外部中斷設計實例 ..................................................................................140
5.6.1 STM32F1 外部中斷硬件設計 ......................................................................140
5.6.2 STM32F1 外部中斷軟件設計 ......................................................................140
第 6 章 STM32 GPIO ................................................................................................146
6.1 STM32 通用輸入輸出接口概述 ..............................................................................146
6.1.1 輸入通道 ......................................................................................................148
6.1.2 輸出通道 ......................................................................................................149
6.2 STM32 的 GPIO 功能 ..............................................................................................150
6.2.1 普通 I/O 功能 ...............................................................................................150
6.2.2 單獨的位設置或位清除 ...............................................................................150
6.2.3 外部中斷/喚醒線 .........................................................................................150
6.2.4 復用功能 ......................................................................................................151
6.2.5 軟件重新映射 I/O 復用功能 ........................................................................151
6.2.6 GPIO 鎖定機制 ............................................................................................151
6.2.7 輸入配置 ......................................................................................................151
6.2.8 輸出配置 ......................................................................................................152
6.2.9 復用功能配置 ..............................................................................................153
6.2.10 模擬輸入配置 ............................................................................................153
6.2.11 STM32 的 GPIO 操作 ................................................................................154
6.2.12 外部中斷映射和事件輸出 ..........................................................................156
6.2.13 GPIO 的主要特性 ......................................................................................156
6.3 STM32 的 GPIO 常用庫函數 ..................................................................................157
6.4 STM32 的 GPIO 使用流程 ......................................................................................165
6.4.1 普通 GPIO 配置 ...........................................................................................165
全書.indd 8 2024/3/7 15:46:50 目錄 IX
6.4.2 I/O 復用功能 AFIO 配置 .............................................................................165
6.5 STM32 的 GPIO 輸出應用實例 ...............................................................................165
6.5.1 STM32 的 GPIO 輸出應用硬件設計 ............................................................165
6.5.2 STM32 的 GPIO 輸出應用軟件設計 ............................................................166
6.6 STM32 的 GPIO 輸入應用實例 ...............................................................................172
6.6.1 STM32 的 GPIO 輸入應用硬件設計 ............................................................172
6.6.2 STM32 的 GPIO 輸入應用軟件設計 ............................................................172
第 7 章 STM32 定時器 ..............................................................................................176
7.1 STM32 定時器概述 .................................................................................................176
7.2 STM32 基本定時器 .................................................................................................179
7.2.1 基本定時器介紹 ...........................................................................................179
7.2.2 基本定時器的功能 .......................................................................................180
7.2.3 STM32 基本定時器的寄存器 ......................................................................182
7.3 STM32 通用定時器 .................................................................................................183
7.3.1 通用定時器介紹 ...........................................................................................183
7.3.2 通用定時器的功能描述 ...............................................................................183
7.3.3 通用定時器的工作模式 ...............................................................................188
7.3.4 通用定時器的寄存器 ...................................................................................192
7.4 STM32 定時器庫函數 .............................................................................................192
7.5 STM32 定時器應用實例 .........................................................................................205
7.5.1 STM32 的通用定時器配置流程 ...................................................................205
7.5.2 定時器應用的硬件設計 ...............................................................................207
7.5.3 定時器應用的軟件設計 ...............................................................................207
7.6 SysTick 系統滴答定時器 ......................................................................................... 211
7.6.1 SysTick 功能綜述 ........................................................................................ 211
7.6.2 SysTick 配置例程 ........................................................................................213
第 8 章 STM32 通用同步/異步收發器 ........................................................................215
8.1 串行通信基礎 ..........................................................................................................215
8.1.1 串行異步通信數據格式 ...............................................................................215
8.1.2 串行同步通信數據格式 ...............................................................................216
8.2 STM32 的 USART 工作原理 ...................................................................................216
8.2.1 USART 介紹 ................................................................................................217
8.2.2 USART 的主要特性 .....................................................................................217
全書.indd 9 2024/3/7 15:46:50 X Arm 嵌入式系統原理及應用——STM32F103 微控制器架構、編程與開發
8.2.3 USART 的功能 ............................................................................................218
8.2.4 USART 的通信時序 .....................................................................................221
8.2.5 USART 的中斷 ............................................................................................222
8.2.6 USART 的相關寄存器 .................................................................................222
8.3 STM32 的 USART 庫函數 .......................................................................................223
8.4 STM32 的 USART 串行通信應用實例 ....................................................................231
8.4.1 STM32 的 USART 基本配置流程 ................................................................231
8.4.2 USART 串行通信應用的硬件設計 ..............................................................232
8.4.3 USART 串行通信應用的軟件設計 ..............................................................233
第 9 章 STM32 SPI 串行總線 ....................................................................................241
9.1 STM32 的 SPI 通信原理 ..........................................................................................241
9.1.1 SPI 串行總線概述 ........................................................................................242
9.1.2 SPI 串行總線互連方式 ................................................................................244
9.2 STM32F1 SPI 串行總線的工作原理 .......................................................................245
9.2.1 SPI 串行總線的特徵 ....................................................................................245
9.2.2 SPI 串行總線的內部結構.............................................................................246
9.2.3 SPI 串行總線時鐘信號的相位和極性 ..........................................................248
9.2.4 STM32 的 SPI 配置 ......................................................................................249
9.2.5 STM32 的 SPI 數據發送與接收過程 ...........................................................251
9.3 STM32 的 SPI 庫函數 .............................................................................................253
9.4 STM32 SPI 與 Flash 存儲器接口的應用實例 ..........................................................256
9.4.1 STM32 的 SPI 配置流程 ..............................................................................256
9.4.2 SPI 與 Flash 存儲器接口的硬件設計 ...........................................................257
9.4.3 SPI 與 Flash 存儲器接口的軟件設計 ...........................................................257
第 10 章 STM32 I2C 串行總線 ...................................................................................265
10.1 STM32 I2C 串行總線的通信原理 .........................................................................265
10.1.1 STM32 I2C 串行總線概述 .......................................................................265
10.1.2 STM32 I2C 串行總線的數據傳輸 ............................................................268
10.2 STM32 I2C 串行總線接口 .....................................................................................270
10.2.1 STM32 I2C 串行總線的主要特性 ............................................................270
10.2.2 STM32 I2C 串行總線的內部結構 ............................................................271
10.2.3 STM32 I2C 串行總線的功能描述 ............................................................272
10.3 STM32F103 的 I2C 庫函數 ...................................................................................273
全書.indd 10 2024/3/7 15:46:50 目錄 XI
10.4 STM32 I2C 與 EEPROM 接口的應用實例 ............................................................279
10.4.1 STM32 的 I2C 配置流程 ..........................................................................279
10.4.2 STM32 I2C 與 EEPROM 接口的硬件設計 ..............................................280
10.4.3 STM32 I2C 與 EEPROM 接口的軟件設計 ..............................................280
第 11 章 STM32 A/D 轉換器 ......................................................................................287
11.1 模擬量輸入通道 ....................................................................................................287
11.1.1 模擬量輸入通道的組成 ............................................................................287
11.1.2 A/D 轉換器簡介 .......................................................................................287
11.2 模擬量輸入信號類型與量程自動轉換 ..................................................................288
11.2.1 模擬量輸入信號類型 ...............................................................................288
11.2.2 量程自動轉換 ...........................................................................................288
11.3 STM32F103ZET6 集成的 ADC 模塊.....................................................................289
11.3.1 STM32 的 ADC 主要特徵 ........................................................................289
11.3.2 STM32 的 ADC 模塊結構 ........................................................................290
11.3.3 STM32 的 ADC 功能................................................................................294
11.3.4 STM32 的 ADC 應用特徵 ........................................................................298
11.4 STM32 的 ADC 庫函數 .........................................................................................302
11.5 STM32 的模數轉換器應用實例 ............................................................................ 311
11.5.1 STM32 的 ADC 配置流程 ........................................................................ 311
11.5.2 ADC 應用的硬件設計 ..............................................................................312
11.5.3 ADC 應用的軟件設計 ..............................................................................312
第 12 章 STM32 DMA 控制器 ....................................................................................319
12.1 STM32 DMA 的基本概念 .....................................................................................319
12.1.1 DMA 的定義 ............................................................................................319
12.1.2 DMA 在嵌入式實時系統中的價值 ..........................................................320
12.1.3 DMA 傳輸的基本要素 .............................................................................321
12.1.4 DMA 傳輸過程 ........................................................................................321
12.1.5 DMA 的優點與應用 .................................................................................321
12.2 STM32 DMA 的結構和主要特徵 ..........................................................................322
12.3 STM32 DMA 的功能描述 .....................................................................................324
12.3.1 DMA 處理 ................................................................................................324
12.3.2 仲裁器 ......................................................................................................324
12.3.3 DMA 通道 ................................................................................................324
全書.indd 11 2024/3/7 15:46:50 XII Arm 嵌入式系統原理及應用——STM32F103 微控制器架構、編程與開發
12.3.4 DMA 中斷 ................................................................................................326
12.4 STM32 的 DMA 庫函數 ........................................................................................326
12.5 STM32 的 DMA 應用實例 ....................................................................................333
12.5.1 STM32 的 DMA 配置流程 .......................................................................333
12.5.2 DMA 應用的硬件設計 .............................................................................334
12.5.3 DMA 應用的軟件設計 .............................................................................334
參考文獻 .....................................................................................................................340
全書.indd 12 2024/3/7 15:46:50