關(guān)于我們
書單推薦
新書推薦
|
單片微機原理與接口技術(shù)——基于STC8H8K64U系列單片機 讀者對象:本書可作為高等學(xué)校電子信息類、電子通信類、自動化類、計算機應(yīng)用類專業(yè)"單片機原理與應(yīng)用”或"微機原理”課程教材及電子設(shè)計競賽、單片機應(yīng)用工程師考證的培訓(xùn)教材。
本書以STC8H8K64U系列單片機為教學(xué)平臺,該系列單片機代表當今8位機較高水平,包含高級PWM 定時器、USB 模塊及 16 位硬件乘/除法器等高級功能模塊。本書基于 STC 大學(xué)計劃實驗箱(8.3)(主控單 片機為 STC8H8K64U 系列單片機),采用“匯編+C”雙語言編程,精選工程訓(xùn)練實例,設(shè)計多種類型的 習(xí)題。本書內(nèi)容包括單片機基礎(chǔ),對 STC8H8K64U 系列單片機的增強型 8051 內(nèi)核、應(yīng)用系統(tǒng)的開發(fā)工具、 指令系統(tǒng)、匯編及 C 雙語言程序設(shè)計、存儲器與應(yīng)用編程、定時/計數(shù)器、中斷系統(tǒng)、串行通信端口、人 機對話接口的應(yīng)用設(shè)計、12 位 A/D 轉(zhuǎn)換模塊、比較器、SPI 接口、I2C 通信接口、高級 PWM 定時器、USB 模塊、16 位乘/除法器的介紹,以及應(yīng)用其進行低功耗設(shè)計與可靠性設(shè)計的介紹。 本書可作為高等學(xué)校電子信息類、電子通信類、自動化類、計算機應(yīng)用類專業(yè)“單片機原理與應(yīng)用” 或“微機原理”課程教材,也可作為電子設(shè)計競賽、單片機應(yīng)用工程師考證的培訓(xùn)教材,還可作為傳統(tǒng) 8051 單片機應(yīng)用工程師升級轉(zhuǎn)型的參考書。
丁向榮,男,廣東輕工職業(yè)技術(shù)學(xué)院教授,電子信息類專業(yè)教學(xué)骨干,長期從事單片機方面的教學(xué)實踐和教科研工作,具備豐富的相關(guān)經(jīng)驗,其對STC單片機的理解尤為深入,曾編寫并出版過多本相關(guān)教材,獲得市場廣泛認可。
目 錄
第 1 章 認識單片機 ······················································································.1 1.1 單片機概述 ······················································································.1 1.1.1 微型計算機的工作原理 ······························································.1 1.1.2 單片機 ····················································································.5 1.2 STC8H 系列單片機簡介 ······································································.6 1.2.1 STC 系列單片機概述 ·································································.6 1.2.2 STC8H 系列單片機 ····································································.7 1.2.3 STC8H8K64U 系列單片機 ···························································.8 本章小結(jié) ·······························································································.18 習(xí)題 ·····································································································.19 第 2 章 增強型 8051 內(nèi)核 ·············································································.21 2.1 CPU 結(jié)構(gòu) ·······················································································.21 2.2 存儲結(jié)構(gòu) ························································································.22 2.3 并行I/O 口 ·····················································································.28 2.3.1 并行I/O 口的工作模式 ······························································.28 2.3.2 內(nèi)部上拉電阻的設(shè)置·································································.31 2.3.3 施密特觸發(fā)器的設(shè)置·································································.31 2.3.4 電平轉(zhuǎn)換速度的設(shè)置·································································.32 2.3.5 電流驅(qū)動能力的設(shè)置·································································.32 2.3.6 數(shù)字信號輸入使能的設(shè)置 ··························································.32 2.4 時鐘與復(fù)位 ·····················································································.32 2.4.1 時鐘 ······················································································.32 2.4.2 復(fù)位 ······················································································.36 本章小結(jié) ·······························································································.38 習(xí)題 ·····································································································.39 第 3 章 應(yīng)用系統(tǒng)的開發(fā)工具 ·········································································.42 3.1 Keil ?Vision4 集成開發(fā)環(huán)境——單片機應(yīng)用程序的編輯、編譯與調(diào)試流程 ····.42 3.2 在線編程與在線仿真 ·········································································.50 3.2.1 在線可編程電路 ·······································································.50 3.2.2 單片機應(yīng)用程序的下載與運行 ····················································.51 3.2.3 Keil ?Vision4 集成開發(fā)環(huán)境與 STC 仿真器的在線仿真 ······················.53 3.2.4 STC-ISP 在線編程軟件的其他功能 ···············································.54 3.3 仿真軟件 Proteus ··············································································.55 3.4 工程訓(xùn)練 ························································································.55 3.4.1 Keil ?Vision4 集成開發(fā)環(huán)境的操作使用 ·········································.55 3.4.2 STC8H8K64U 系列單片機的在線調(diào)試與在線仿真 ····························.62 3.4.3 Proteus 單片機應(yīng)用系統(tǒng)的仿真 ····················································.66 本章小結(jié) ·······························································································.72 習(xí)題 ·····································································································.72 第 4 章 指令系統(tǒng)與匯編語言程序設(shè)計 ·····························································.75 4.1 指令系統(tǒng) ························································································.75 4.1.1 概述 ······················································································.75 4.1.2 數(shù)據(jù)傳送類指令 ·······································································.81 4.1.3 算術(shù)運算類指令 ·······································································.86 4.1.4 邏輯運算與循環(huán)移位類指令 ·······················································.91 4.1.5 控制轉(zhuǎn)移類指令 ·······································································.95 4.1.6 位操作類指令 ········································································.100 4.2 匯編語言程序設(shè)計 ··········································································.104 4.2.1 匯編語言程序設(shè)計基礎(chǔ) ···························································.104 4.2.2 基本程序結(jié)構(gòu)與程序設(shè)計舉例 ··················································.109 4.3 工程訓(xùn)練 LED 數(shù)碼管的驅(qū)動與顯示(匯編語言版) ······························118 本章小結(jié) ·····························································································.121 習(xí)題 ···································································································.122 第 5 章 C51 與 C51 程序設(shè)計 ······································································.127 5.1 C51 基礎(chǔ) ······················································································.127 5.1.1 C51 數(shù)據(jù)類型 ········································································.129 5.1.2 C51 的變量 ···········································································.131 5.1.3 8051 單片機特殊功能寄存器變量的定義 ······································.132 5.1.4 8051 單片機位尋址區(qū)(20H~2FH)位變量的定義 ························.134 5.1.5 函數(shù)的定位 ···········································································.134 5.1.6 中斷服務(wù)函數(shù) ········································································.135 5.1.7 函數(shù)的遞歸調(diào)用與再入函數(shù) ·····················································.136 5.1.8 在C51 中嵌入?yún)R編語言程序 ·····················································.136 5.2 C51 程序設(shè)計 ················································································.137 5.2.1 C51 程序框架 ········································································.137 5.2.2 C51 程序設(shè)計舉例 ··································································.140 5.3 工程訓(xùn)練 LED 數(shù)碼管的驅(qū)動與顯示(C 語言版) ·······························.142 本章小結(jié) ·····························································································.144 習(xí)題 ···································································································.145 第 6 章 存儲器與應(yīng)用編程 ··········································································.147 6.1 程序存儲器 ···················································································.147 6.2 片內(nèi)基本 RAM ···············································································.149 6.3 擴展RAM ····················································································.150 6.4 EEPROM ······················································································.154 6.5 工程訓(xùn)練 ······················································································.160 6.5.1 片內(nèi)擴展 RAM 的測試 ····························································.160 6.5.2 EEPROM 的測試 ····································································.161 本章小結(jié) ·····························································································.165 習(xí)題 ···································································································.166 第 7 章 定時/計數(shù)器 ···················································································.168 7.1 定時 /計數(shù)器(T0/T1)的結(jié)構(gòu)和工作原理 ············································.168 7.2 定時 /計數(shù)器(T0/T1)的控制 ···························································.169 7.3 定時 /計數(shù)器(T0/T1)的工作方式 ·····················································.172 7.4 定時 /計數(shù)器(T0/T1)的應(yīng)用舉例 ·····················································.175 7.4.1 定時應(yīng)用 ··············································································.176 7.4.2 計數(shù)應(yīng)用 ··············································································.177 7.4.3 T0、T1 的綜合應(yīng)用 ································································.178 7.5 定時 /計數(shù)器 T2 ··············································································.181 7.5.1 T2 的電路結(jié)構(gòu) ······································································.181 7.5.2 T2 的控制寄存器 ···································································.181 7.6 定時 /計數(shù)器 T3、T4 ········································································.182 7.6.1 電路結(jié)構(gòu) ··············································································.182 7.6.2 控制寄存器 ···········································································.183 7.7 可編程時鐘輸出 ·············································································.184 7.7.1 T0~T4 的可編程時鐘輸出 ·······················································.184 7.7.2 可編程時鐘的應(yīng)用舉例 ···························································.185 7.8 工程訓(xùn)練 ······················································································.187 7.8.1 定時/計數(shù)器的定時應(yīng)用 ···························································.187 7.8.2 定時/計數(shù)器的計數(shù)應(yīng)用 ···························································.189 7.8.3 定時/計數(shù)器的綜合應(yīng)用 ···························································.191 7.8.4 可編程時鐘輸出 ·····································································.193 本章小結(jié) ·····························································································.195 習(xí)題 ···································································································.196 第 8 章 中斷系統(tǒng) ······················································································.199 8.1 中斷系統(tǒng)概述 ················································································.199 8.1.1 中斷系統(tǒng)的幾個概念·······························································.199 8.1.2 中斷的技術(shù)優(yōu)勢 ·····································································.200 8.1.3 中斷系統(tǒng)需要解決的問題 ························································.201 8.2 STC8H8K64U 系列單片機中斷系統(tǒng)的簡介 ···········································.201 8.2.1 中斷請求 ··············································································.201 8.2.2 中斷響應(yīng)、中斷服務(wù)與中斷返回 ···············································.210 8.2.3 中斷應(yīng)用舉例 ········································································.213 8.3 STC8H8K64U系列單片機外部中斷源的擴展 ·············································.218 8.4 工程訓(xùn)練 ······················································································.221 8.4.1 定時中斷的應(yīng)用編程·······························································.221 8.4.2 外部中斷的應(yīng)用編程·······························································.222 本章小結(jié) ·····························································································.224 習(xí)題 ···································································································.225 第 9 章 串行通信端口 ················································································.228 9.1 串行通信基礎(chǔ) ················································································.228 9.2 串行通信端口 1 ···············································································.231 9.2.1 控制寄存器 ···········································································.231 9.2.2 工作方式 ··············································································.234 9.2.3 波特率 ·················································································.237 9.2.4 應(yīng)用舉例 ··············································································.238 9.3 STC8H8K64U 系列單片機與計算機的通信 ···········································.251 9.3.1 接口設(shè)計 ··············································································.251 9.3.2 程序設(shè)計 ··············································································.253 9.4 串行通信端口 2* ············································································.256 9.5 串行通信端口 3* ············································································.257 9.6 串行通信端口 4* ············································································.259 9.7 工程訓(xùn)練 ······················································································.260 9.7.1 單片機間的雙機通信·······························································.260 9.7.2 單片機與計算機間的串行通信 ··················································.263 本章小結(jié) ·····························································································.266 習(xí)題 ···································································································.267 第 10 章 人機對話接口的應(yīng)用設(shè)計 ································································.270 10.1 單片機應(yīng)用系統(tǒng)的設(shè)計和開發(fā) ·························································.270 10.1.1 單片機應(yīng)用系統(tǒng)的設(shè)計原則 ····················································.270 10.1.2 單片機應(yīng)用系統(tǒng)的開發(fā)流程 ····················································.271 10.1.3 單片機應(yīng)用系統(tǒng)工程報告的編制 ··············································.274 10.2 鍵盤接口與應(yīng)用編程 ·····································································.276 10.3 LCD 接口與應(yīng)用編程 ·····································································.285 10.3.1 LCD 模塊概述 ·····································································.285 10.3.2 點陣字符型液晶顯示模塊 LCD1602 ··········································.285 10.3.3 點陣圖形型 LCD 模塊 LCD12864 ·············································.293 10.4 工程訓(xùn)練 ····················································································.302 10.4.1 單片機與矩陣鍵盤的接口與應(yīng)用 ···············································.302 10.4.2 單片機與 LCD12864(含中文字庫)的接口與應(yīng)用 ·······················.306 本章小結(jié) ·····························································································.313 習(xí)題 ···································································································.314 第 11 章 A/D 轉(zhuǎn)換模塊 ···············································································.318 11.1 A/D 轉(zhuǎn)換模塊的結(jié)構(gòu) ·····································································.318 11.2 A/D 轉(zhuǎn)換模塊的控制 ·····································································.319 11.3 A/D 轉(zhuǎn)換模塊的應(yīng)用 ·····································································.323 11.4 工程訓(xùn)練 ····················································································.325 11.4.1 測量內(nèi)部 1.19V 基準電壓 ·······················································.325 11.4.2 ADC 鍵盤 ···········································································.328 本章小結(jié) ·····························································································.332 習(xí)題 ···································································································.332 第 12 章 比較器 ························································································.334 12.1 比較器的內(nèi)部結(jié)構(gòu)與控制 ·······························································.334 12.2 比較器的應(yīng)用 ··············································································.337 12.3 工程訓(xùn)練 應(yīng)用比較器和 A/D 轉(zhuǎn)換模塊測量單片機內(nèi)部 1.19V 基準電壓 ····.338 本章小結(jié) ·····························································································.342 習(xí)題 ···································································································.342 第 13 章 SPI 接口 ·····················································································.344 13.1 結(jié)構(gòu) ····························································································.344 13.2 控制 ····························································································.346 13.3 配置與通信方式 ···········································································.347 13.4 應(yīng)用編程 ····················································································.352 13.5 工程訓(xùn)練 ····················································································.357 13.5.1 通過 SPI 串行總線訪問 PM25LV040 ··········································.357 13.5.2 ILI9325 驅(qū)動 TFT 觸摸顯示屏的測試 ········································.370 本章小結(jié) ·····························································································.371 習(xí)題 ···································································································.372 第 14 章 I2C 通信接口 ················································································.373 14.1 I2C 總線 ······················································································.373 14.2 STC8H8K64U 系列單片機 I2C 通信接口的介紹 ····································.381 14.2.1 I2C 通信接口的控制 ······························································.381 14.2.2 主機模式的應(yīng)用編程 ·····························································.385 14.2.3 從機模式的應(yīng)用編程 ·····························································.388 14.3 工程訓(xùn)練 I 2C 通信接口的應(yīng)用 ·······················································.390 本章小結(jié) ·····························································································.395 習(xí)題 ···································································································.395 第 15 章 高級 PWM 定時器 ·········································································.398 15.1 PWMA 概述 ················································································.399 15.2 PWMA 的特殊功能寄存器 ······························································.400 15.3 PWMA 的應(yīng)用編程 ·······································································.426 15.3.1 PWMA 的時基單元與操作 ······················································.427 15.3.2 時鐘 /觸發(fā)控制器的操作 ·························································.430 15.3.3 捕獲 /比較通道的操作 ····························································.433 15.4 中斷與操作 ·················································································.446 15.5 工程訓(xùn)練 高級 PWM 定時器的應(yīng)用·················································.446 本章小結(jié) ·····························································································.451 習(xí)題 ···································································································.451 第 16 章 USB 模塊 ····················································································.454 16.1 USB 概述 ····················································································.454 16.2 USB 模塊的控制 ···········································································.455 16.3 USB 模塊的操作文件 ·······································································.466 16.4 工程訓(xùn)練 計算機通過 USB 接口發(fā)送指令讀取 A/D 轉(zhuǎn)換模塊的測試參數(shù) ··.470 本章小結(jié) ·····························································································.481 習(xí)題 ···································································································.481 第 17 章 16 位乘/除法器 ·············································································.483 17.1 16 位乘/除法器的操作 ······································································.483 17.2 16 位乘/除法器的應(yīng)用編程 ······························································.485 17.3 工程訓(xùn)練 STC8H8K64U 系列單片機 16 位乘/除法器的應(yīng)用 ··················.488 本章小結(jié) ·····························································································.490 習(xí)題 ···································································································.491 第 18 章 低功耗設(shè)計與可靠性設(shè)計 ································································.492 18.1 低功耗設(shè)計 ·················································································.492 18.2 可靠性設(shè)計 ·················································································.496 本章小結(jié) ·····························································································.499 習(xí)題 ···································································································.500 參考文獻 ···································································································.502
你還可能感興趣
我要評論
|