【正文】
I 摘 要 單片機(jī)是把主要 的 計算機(jī)功能部件都集成在一塊芯片上的微型計算機(jī)。它是一種集 微處理器 和多 種 接口于一體的微控制器,被廣泛應(yīng)用在智能產(chǎn)品和工業(yè)自動化上,而 51 單片機(jī)是個單片機(jī)中最為典型和最有代表性的一種。 我的設(shè)計就是以 MCS—51 系列中的 8751H 為核心,與鍵盤、顯示器連接,通過調(diào)節(jié)脈沖信號頻率,進(jìn)而實(shí)現(xiàn)對步進(jìn)電動機(jī)轉(zhuǎn)速的控制。 步進(jìn)電機(jī)是一種易于精確控制的電機(jī) ,由于其良好的性能而受到廣泛的應(yīng)用。其控制方法也多種多樣。 8751H為核心的微機(jī)控制調(diào)速器很好解決了各種控制技術(shù)問題。整個系統(tǒng)結(jié)構(gòu) 簡單。通 過改變軟件設(shè)計,可靈活地實(shí)現(xiàn)各種控制功能。 我選擇的控制方法:對單片機(jī) 8751H進(jìn)行編程 ,實(shí)現(xiàn)對四相步進(jìn)電機(jī)的控制 ,以達(dá)到精確定位的目的 。 使 8751H單片機(jī)并行 口 P1口高四位 ~ 分別與驅(qū)動電路的接口 A、 B、 C、 D 相連 ,并使驅(qū)動電路的 4 個輸出引腳分別與步 進(jìn)電機(jī)的 4 、 3 、 2 、 1四個勵磁線圈的引腳相連。通過對單片機(jī)進(jìn)行編程 ,使數(shù)據(jù)從 P1口 的 高四位輸出經(jīng)驅(qū) 動電路放大后控制步進(jìn)電機(jī) ,使其按照單片機(jī)編寫的程序按步驟的進(jìn)行正序旋轉(zhuǎn)或逆序旋轉(zhuǎn) 。 設(shè)計時考慮到 CPU在執(zhí)行指令時可能受到干擾的沖擊 ,導(dǎo)致 程序 ‖跑飛 ‖或者進(jìn)入 ‖死循環(huán) ‖,因此 ,設(shè)計了看門狗電路 ,使用的是 MAXIM公司生產(chǎn)的微處理系統(tǒng)監(jiān)控集成芯片 MAXI813。 本文還詳細(xì) 地 給出了相關(guān)的硬件框圖和軟件流程圖,并編制了該匯編語言程序。 關(guān)鍵字: 8751H;步進(jìn)電動機(jī);單片機(jī)控制; II Abstract The single chip microputer is the microputer,which intergrates the main puter function part on a is a microcontroller which is a collection of microprocessor and many kinds of interfaces in a body, which is widely applied in the intelligent product and in the industrial automation, but 51 SCM is the most typical and the most repesentative one kind in SCM. This design takes MCS51series 8751H as a core, connects with the keyboard and the monitor, adjusts the pulse signal frequency, then realizes the stepping motor speed control. The stepping motor is a kind of motor easy to is used widely for its are many ways to control the stepping motor. The Microputer control speed regulator taking 8751H as a core solves the diversifyed kind of controltechnic. The whole system structure is simple. Diversified kind of control function is realized flexibly by changing software design. My design method is programming with SCM 8751H, realizing the control of the stepping motor in order to achieve the accurate the high four bits ~ of 8751H’s parallel P1 with driver circuit interface four input pins A,B,C,D repectively, and connect the output pins of the driver circuit with the four input exciting coil pins of the stepping motor. Programming to SCM makes the data output of the high four bits to control the stepping motor after amplified by the driver circuit, which makes the stepping motor rotate clockwise and anticlockwise. The possible impacts during the CPU operation which leads the ―running out‖,or ―death cycle‖of program are taken into ,the‖watchdog‖circuit is designed using microprocessor integrated chip MAXI813 produced by United States MAXIM. This article in detail has given the related hardware diagram and the software fiow chart,and has established this assembly language procedure. The keyword :8751H; stepping motor; SCM control III 目 錄 摘 要 ....................................................................................................................... I Abstract ......................................................................................................................... II 第 1 章 引言 .................................................................................................................1 第 2 章 概述 .................................................................................................................3 第 3 章 主要器件介紹 .................................................................................................6 單片機(jī) (8751)系統(tǒng)簡介 ...................................................................................6 CPU 結(jié)構(gòu) ...............................................................................................7 I/O 接口線 .............................................................................................9 定時器 /計數(shù)器 T0、 T1 .....................................................................10 存儲器 ................................................................................................13 地址鎖存器 74LS373 ..........................................................................15 8255 芯片介紹 ...............................................................................................15 8255 內(nèi)部結(jié)構(gòu) ...................................................................................15 引腳功能 .............................................................................................16 工作方式 .............................................................................................17 第 4 章 步進(jìn)電動機(jī) ...................................................................................................19 步進(jìn)電動機(jī)的結(jié)構(gòu) ........................................................................................19 步進(jìn)電動機(jī)的工作原理 ...............................................................................19 步進(jìn)電動機(jī)的工作方式 ...............................................................................20 步進(jìn)電動機(jī)的驅(qū)動 ........................................................................................21 第 5 章 硬件設(shè)計 .......................................................................................................23 步進(jìn)電動機(jī)的單片機(jī)控制 ............................................................................23 步進(jìn)電動機(jī)的通電順序狀態(tài)表 .........................................................24 鍵盤和顯示設(shè)計 ...........................................................................................24 鍵盤 .....................................................................................................24 顯示 .....................................................................................................25 電源電路設(shè)計 ................................................................................................26 抗干擾設(shè)計 ....................................................................................................27 IV 看門狗電路 ....................................................................................................28 MAX813L 功能簡介 ...........................................................................29 看門狗電路各引腳功能 .......