【正文】
1 常州機電職業(yè)技術(shù)學院 畢業(yè)設(shè)計(論文) 題 目: 單片機控制“航標燈”的控制系統(tǒng)的設(shè)計與調(diào)試 2 摘要 單片微型計算機簡稱單片機。它是把組成微型計算機的各功能部件:中央處理器、 CPU、隨機存取存儲器 RAM、只讀存儲器 ROM、 I/O 接口電路、定時器/計數(shù)器以及串行通信接口等制作在一塊集成芯片中,構(gòu)成一個完整的微型計算機。單片機主要應用于控制領(lǐng)域,由于其具有可靠性高、體積小、價格低、易于產(chǎn)品化等特點,因而在智能儀器儀表、實時工業(yè)控制、智能終端、通信設(shè)備、導航系統(tǒng)、家用電器等自控領(lǐng)域獲得 廣泛應用 [1]。 步進電機是一種能將電脈沖信號轉(zhuǎn)換成角位移或線位移的機電元件 ,實質(zhì)上是一種數(shù)字 /角度轉(zhuǎn)換器步進電機控制系統(tǒng)主要由步進控制器 ,功率放大器及步進電機等組成 .步進控制器由緩沖寄存器 ,環(huán)形分配器 ,控制邏輯及正 ,反轉(zhuǎn)控制門等組成 ,能把輸入的脈沖轉(zhuǎn)換成環(huán)形脈沖 ,以便控制步進電機 ,并能進行正反向控制 .但由于步進控制器線路復雜 .成本高 .采用單片機控制 ,用軟件代替上述步進控制器 ,使得線路簡單 ,成本低 ,可靠性大大增加 ,靈活改變步進電機的控制方案 ,無需邏輯電路組成時序發(fā)生器 .軟件編程可靈活產(chǎn)生不同類型步進電機 勵磁序列來控制各種步進電機的運行方式并可實現(xiàn)一臺單片機控制多臺電機 .提供靈活多樣的控制手段和提高控制精度對復雜繁瑣的控制易于實現(xiàn) ,尤其在本系統(tǒng)中更顯示出微機控制的優(yōu)越性。 本設(shè)計采用凌陽 16 位單片機 SPCE061A 對步進電機進行控制,通過 IO 口輸出的具有時序的方波作為步進電機的控制信號,信號經(jīng)過芯片 L298N驅(qū)動步進電機;同時,用 4X4 的鍵盤來對電機的狀態(tài)進行控制,并用數(shù)碼管顯示電機的轉(zhuǎn)速,采用 74LS164 作為 4 位單個數(shù)碼管的顯示驅(qū)動,從單片機輸入信號;利用凌陽單片機的語音功能播報電機的轉(zhuǎn)速。 關(guān)鍵詞: 單片機 步進電機 ABSTRACT[2] The single slice of microputers is abbreviated as the onechip puter. It is every function part which makes up the microputer: Central processing unit, CPU, arbitrary access memory RAM , readonly memory ROM, I/O interface circuit , timer / counter and serial munication 3 interface ,etc. make in the integrated chip together, form an intact microputer. Onechip puter apply controlled field to mainly, because it have dependability high , small , price low , easy mercialization ,etc. characteristic, therefore won extensive application in fields of automatic control such as intellectual instrument and apparatus , realtime industrial control , intelligent terminal , munication equipment , navigation system , household appliances ,etc. It is that one kind can change the electric pulse signal into a electromechanical ponent of angle displacement or line displacement to walk into the electrical machinery, it is a kind of figure / angle converter tha t is walked into the control system of the electrical machinery to mainly walk into the controller in fact, power amplifier and walking into the electrical machinery ,etc. make up . Walked into the controller to buffer the register , the annular distributor, control logic and, overturn , control door ,etc. make up , can change the pulse input into into an annular pulse , in order to control , walk into electrical machinery , can carry on positive and negative to control. But because walk into the controller circuit plicatedly. With high costs. Adopt onechip puter control , replace with software described above to walk into the controller , make the circuit simple, with low costs, dependability increases greatly, change the control scheme of walking into the electrical machinery flexibly , do not need logical circuit to make up the time sequence generator . Software programming very flexible to produce , walk into electrical machinery excitation array e , control various operation way to walk into electrical machinery and can realize one machine control many sets of electrical machinery while being different kinds of. It is easy to realize to offer the flexible control means and improving the precision of controlling to plicated and tedious control, demonstrate the superiority that the puter controls especially in this system even more. Design , adopt , insult male genital 16 onechip puter SPCE061A to walk into electrical machinery control originally, square wave with time sequence as the control signal of walking into the electrical machinery through what IO mouth is outputted, the signal drives and walks into the electrical machinery through the chip L298N。 Meanwhile , e state in electrical machinery go on , control with keyboard of 4X4 , in charge of rotational speed to reveal electrical machinery with number, adopt 74LS164 urge as 4 single number display that in charge of , from the input signal of the one chip puter。 Utilize the pronunciation function of insulting the open one chip puter to report the rotational speed of the electrical machinery. Keyword: Onechip puter Walk into the electrical machinery 緒論 4 近十幾年來,單片機在生產(chǎn)過程控制、自動檢測、數(shù)據(jù)采集與處理、科技計算、商業(yè)管理和辦公室自動化等方面獲得了廣泛的應用。單片機具有體積小、重量輕、耗能省、價格低、可靠性高和通用靈活等優(yōu)點,因此也廣泛應用于衛(wèi)星定句、汽車火花控制、交通白動管理和微波爐等專用控制上。近幾年來,單片機的發(fā)展更為迅速,它已滲透到諸多學科的領(lǐng)域,以及人們生活的各個方面。 單片機不求規(guī)模大,只求小而全。廠家在一個芯片上制成了 CPU 和一定容量的程序存儲器和數(shù)據(jù)存儲器以及一定數(shù)量的輸入 /輸出接口 (Intel)。在一個大規(guī)模集 成電路芯片上構(gòu)造了完整的計算機結(jié)構(gòu),故稱之為單片機 MCS51系列中的一片 8751芯片 [3],內(nèi)部構(gòu)造了完整的計算機硬件系統(tǒng)。從 CPU、存儲器到輸入輸出端口,一應俱全。只要寫入程序,就可完成中央控制或數(shù)據(jù)采集、處理及通信傳輸?shù)男畔⑻幚頇C, MCS51 單片機指令系統(tǒng)中為適應控制的需要設(shè)有極強的位處理功能,具有加、減、乘、除指令 。CPU 時鐘高達 12MHz,完成單字節(jié)乘法或除法運算僅需要 4Ns。具有多機通信功能,可作為多機系統(tǒng)中的一個子系統(tǒng)。 近年來,在國際上出現(xiàn)了 Mechanics 和 electronics 復合成 Mechtronics這個新詞,我國譯為 機電一體化 。這種機械和電子技術(shù)、信息技術(shù)緊密結(jié)合的新的學科領(lǐng)域是先進制造技術(shù)研究和普及的結(jié)果。機電一體化產(chǎn)品要實現(xiàn)電器控制的實時性、高可靠性、可編程和一定的人工智能。同時追求體積小、價格低,甚至低功耗等。正是針對上述種種要求而設(shè)計的單片機白然成為機電一體化控制器的最佳選擇。 單片機出現(xiàn)的歷史并不長,它的產(chǎn)生與發(fā)展與微處理器的產(chǎn)生與發(fā)展大體上同步,也經(jīng)歷了四個階段 [4]: 第一階段 :1971~1974 年, 4 位微處理器工 intel 4004 及 8 位微處理器工intel 8008,這些計算機價格便宜、功能有限,只用于消耗類電子產(chǎn)品。 第二階段 :1974~1978 年,初級單片機階段,以工 intel 公司的 MCS48為代表, 8 位單片機。 第三階段 :1978~1983 年,高性能單片機階段。以工 Intel 公司的 MCS51, Motorola 公司的 6801 和 Zilog 公司的 Z8 等為代表。這一階段推出的單片機普遍帶有串行口,有多級中斷處理系統(tǒng)、 16 位定時器 /計