【正文】
畢業(yè)設(shè)計(jì) 課 題 名 稱 基于單片機(jī)的步進(jìn)電機(jī)控制設(shè)計(jì) 此設(shè)計(jì)還有 仿真 程序,有需要的朋友下載了文檔后留下你的郵箱,方便我傳給你。 I 摘 要 本論文主要 介紹了 基于單片機(jī)的步進(jìn)電機(jī)控制的規(guī)則 、 硬件 結(jié)構(gòu)、 軟件代碼的編寫及 工作原理、 以及液晶模塊 12864LCD 的詳細(xì)介紹 以及 指令集 。 模擬出單片機(jī)系統(tǒng)下的步進(jìn)電機(jī)轉(zhuǎn)速控制, 具有 任意轉(zhuǎn)速選擇、轉(zhuǎn)動時間、正反轉(zhuǎn) 、 加速和減速設(shè)置、系統(tǒng) 低功耗、可實(shí)現(xiàn)在線調(diào)試等特點(diǎn)。本系統(tǒng) 是 以 單片機(jī) 為 其 控制核心, 以有源晶振構(gòu)成的電路作為時鐘信號, 通過鍵盤輸入選擇 向 單片機(jī)控制系統(tǒng) 發(fā)出 步進(jìn)轉(zhuǎn)動 控制命令 ,控制系統(tǒng) 接收命令后 做出一系列必要的判斷后,控電機(jī)的轉(zhuǎn)速、轉(zhuǎn)向等 。本設(shè)計(jì)已通過了實(shí)驗(yàn) 仿真,運(yùn)行穩(wěn)定,達(dá)到了基本的設(shè)計(jì)要求。 本設(shè)計(jì)要分為兩大塊:一塊為硬件電路組成部分,一塊為軟件程序設(shè)計(jì)部分。在硬件電路里主要包括有源晶振部分、鍵盤輸入控制部分、電機(jī)驅(qū)動電路及液晶顯示部分等與單片機(jī)的接線設(shè)計(jì);軟件編程方面主要是子程序和主程序的編寫,包括:初始化代碼、液晶驅(qū)動代碼、時間記錄代碼、表格數(shù)據(jù)代碼等。 關(guān)鍵詞 : 單片機(jī);步進(jìn)電機(jī); 12864LCD;指令集 II Abstract This thesis is mainly introduce the Prepared and working principles about regulation、 structure of hardware、 software code of stepping motor control based on MCU as well as detail information and instruction set on LCD Module 12864LCD. This thesis also simulates that under the system of singlechip stepping motor speed control has the disadvantages of changing speed、 time arbitrary、 Positive and negative transfer、 installation of accelerated and deceleration、 lowpower system and online debugging. Singlechip as core of control and the circuit made up by active crystal as clock signal, the stepper motor speed control system starts to making a series of necessary judgment and then control rotate speed and change direction when it receive the mand of stepper transfer control from singlechip control system by keyboard. As run steady, this project has already passed the simulation and has achieved the basic purpose. This project consists of two parties. One is hardware circuit and the other is software programming. In the part of hardware circuit is include active crystal、 control system of keyboard input 、 system of motor drive circuit and liquid crystal system. In the second part, Design of connection of singlechip、software prepared is the mainly prepared of Subroutine and Main program including initialization code 、 liquid drive code 、 the timing of recording code form data code[8]. Key words: MCU; stepper motor; 12864LCD; Instruction Set. III 目 錄 摘 要 ..................................................................................................................................... I Abstract ............................................................................................................................... II 第 1 章 緒論 .......................................................................................................................1 課題的來源 .........................................................................................................1 課題研究的意義 ...............................................................................................1 課題國內(nèi)研究現(xiàn)狀 ...........................................................................................1 課題研究的目的和主要內(nèi)容 ........................................................................2 第 2 章 步進(jìn)電機(jī)方案設(shè)計(jì)與分析 .............................................................................3 方案提出 .............................................................................................................3 可行性分析 .........................................................................................................4 主要器件選擇 ....................................................................................................4 第 3 章 系統(tǒng)硬件設(shè)計(jì) ....................................................................................................6 AMPIRE128*64 液晶屏介紹 ...........................................................................6 HD61202 及其指令集介紹 ..............................................................................7 晶振、復(fù)位、驅(qū)動電路 .................................................................................9 液晶顯示屏與單片機(jī)接口電路 ................................................................. 10 控鍵與單 片機(jī)接口電路 ............................................................................... 11 第 4 章 系統(tǒng)軟件設(shè)計(jì) .................................................................................................. 13 電機(jī)流程圖 ....................................................................................................... 13 液晶屏驅(qū)動代碼設(shè)計(jì) .................................................................................... 14 固定字符 顯示代碼 ......................................................................................... 18 中斷子程序 ....................................................................................................... 19 漢字表 ................................................................................................................ 19 字符表 ................................................................................................................ 22 延時子程序 ....................................................................................................... 22 主函數(shù)程序 ....................................................................................................... 23 第 5 章 系統(tǒng)仿真 ........................................................................................................... 25 Keil2 編譯環(huán)境介紹 ..................................................................................... 25 Proteus 仿真平臺 ......................................................................................... 26 IV 建立工程項(xiàng)目 .................................................................................................. 28 Proteus 中原理圖的繪制及文件的加載 ................................................ 32 開機(jī)界面顯示 .................................................................................................. 32 控制界面顯示 .................................................................................................. 33 仿真結(jié)果分析及解決方法 ...........................................