【正文】
I 摘 要 單片機(jī)是把主要 的 計(jì)算機(jī)功能部件都集成在一塊芯片上的微型計(jì)算機(jī)。它是一種集 微處理器 和多 種 接口于一體的微控制器,被廣泛應(yīng)用在智能產(chǎn)品和工業(yè)自動(dòng)化上,而 51 單片機(jī)是個(gè)單片機(jī)中最為典型和最有代表性的一種。 我的設(shè)計(jì)就是以 MCS—51 系列中的 8751H 為核心,與鍵盤(pán)、顯示器連接,通過(guò)調(diào)節(jié)脈沖信號(hào)頻率,進(jìn)而實(shí)現(xiàn)對(duì)步進(jìn)電動(dòng)機(jī)轉(zhuǎn)速的控制。 步進(jìn)電機(jī)是一種易于精確控制的電機(jī) ,由于其良好的性能而受到廣泛的應(yīng)用。其控制方法也多種多樣。 8751H為核心的微機(jī)控制調(diào)速器很好解決了各種控制技術(shù)問(wèn)題。整個(gè)系統(tǒng)結(jié)構(gòu) 簡(jiǎn)單。通 過(guò)改變軟件設(shè)計(jì),可靈活地實(shí)現(xiàn)各種控制功能。 我選擇的控制方法:對(duì)單片機(jī) 8751H進(jìn)行編程 ,實(shí)現(xiàn)對(duì)四相步進(jìn)電機(jī)的控制 ,以達(dá)到精確定位的目的 。 使 8751H單片機(jī)并行 口 P1口高四位 ~ 分別與驅(qū)動(dòng)電路的接口 A、 B、 C、 D 相連 ,并使驅(qū)動(dòng)電路的 4 個(gè)輸出引腳分別與步 進(jìn)電機(jī)的 4 、 3 、 2 、 1四個(gè)勵(lì)磁線圈的引腳相連。通過(guò)對(duì)單片機(jī)進(jìn)行編程 ,使數(shù)據(jù)從 P1口 的 高四位輸出經(jīng)驅(qū) 動(dòng)電路放大后控制步進(jìn)電機(jī) ,使其按照單片機(jī)編寫(xiě)的程序按步驟的進(jìn)行正序旋轉(zhuǎn)或逆序旋轉(zhuǎn) 。 設(shè)計(jì)時(shí)考慮到 CPU在執(zhí)行指令時(shí)可能受到干擾的沖擊 ,導(dǎo)致 程序 ‖跑飛 ‖或者進(jìn)入 ‖死循環(huán) ‖,因此 ,設(shè)計(jì)了看門(mén)狗電路 ,使用的是 MAXIM公司生產(chǎn)的微處理系統(tǒng)監(jiān)控集成芯片 MAXI813。 本文還詳細(xì) 地 給出了相關(guān)的硬件框圖和軟件流程圖,并編制了該匯編語(yǔ)言程序。 關(guān)鍵字: 8751H;步進(jìn)電動(dòng)機(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)簡(jiǎn)介 ...................................................................................6 CPU 結(jié)構(gòu) ...............................................................................................7 I/O 接口線 .............................................................................................9 定時(shí)器 /計(jì)數(shù)器 T0、 T1 .....................................................................10 存儲(chǔ)器 ................................................................................................13 地址鎖存器 74LS373 ..........................................................................15 8255 芯片介紹 ...............................................................................................15 8255 內(nèi)部結(jié)構(gòu) ...................................................................................15 引腳功能 .............................................................................................16 工作方式 .............................................................................................17 第 4 章 步進(jìn)電動(dòng)機(jī) ...................................................................................................19 步進(jìn)電動(dòng)機(jī)的結(jié)構(gòu) ........................................................................................19 步進(jìn)電動(dòng)機(jī)的工作原理 ...............................................................................19 步進(jìn)電動(dòng)機(jī)的工作方式 ...............................................................................20 步進(jìn)電動(dòng)機(jī)的驅(qū)動(dòng) ........................................................................................21 第 5 章 硬件設(shè)計(jì) .......................................................................................................23 步進(jìn)電動(dòng)機(jī)的單片機(jī)控制 ............................................................................23 步進(jìn)電動(dòng)機(jī)的通電順序狀態(tài)表 .........................................................24 鍵盤(pán)和顯示設(shè)計(jì) ...........................................................................................24 鍵盤(pán) .....................................................................................................24 顯示 .....................................................................................................25 電源電路設(shè)計(jì) ................................................................................................26 抗干擾設(shè)計(jì) ....................................................................................................27 IV 看門(mén)狗電路 ....................................................................................................28 MAX813L 功能簡(jiǎn)介 ...........................................................................29 看門(mén)狗電路各引腳功能 .......