【正文】
h the infiltration in the social field of the puter in recent years, the application of the onechip puter is moving towards deepening constantly, drive tradition is it measure crescent benefit to upgrade day to control at the same time. In measuring in real time and automatically controlled onechip puter application system, the onechip puter often uses as a key part, only onechip puter respect knowledge is not enough, should also follow the structure of the concrete hardware , and direct against and use the software of target’s characteristic to bine concretly, in order to do perfectly. The smallest system one chip puter is in expands at the base of STC89C52RC one chip puter, make it used more convient in the test system. This design mainly expands I/O in the take on chip puter, reset circuit, crystals circuit, the LED display circuitand writes the first floor for scrolling minimum system. Keyword: minimum system, STC89C52RC, scrolling 3 目錄 1.緒論 ........................................................................................................................... 4 .............................................................................................. 5 設(shè)計(jì)目的 ................................................................................................................... 5 設(shè)計(jì)要求 ............................................................................................................ 5 系統(tǒng)基本方案選擇和論證 ................................................................................... 5 、 STC89C52RC介紹 .................................................................................... 6 、時(shí)間周期 ............................................................................................. 11 、 LED燈管 .............................................................................................. 12 、數(shù)碼管 ................................................................................................. 12 、蜂鳴器 ................................................................................................. 12 、鎖存器 ................................................................................................. 13 系統(tǒng)框圖 .......................................................................................................... 13 統(tǒng)的硬件設(shè)計(jì)與實(shí)現(xiàn) ................................................................................................ 14 電源供電模塊的實(shí)現(xiàn) ........................................................................................ 14 復(fù)位電路 .......................................................... 15 晶振電路 .......................................................... 16 4. 系統(tǒng)的軟件設(shè)計(jì) ...................................................................................................... 19 軟件介紹 .......................................................................................................... 19 Keil C51 ................................................................................................... 19 Protel99SE ................................................................................................ 19 Proteus ..................................................................................................... 20 ......................................................... 22 延時(shí)的計(jì)算 ........................................................ 23 ................................................................................................... 24 ................................................................................................................. 24 7. 遇到問 題 ................................................................................................................... 24 ..................................................................................................................... 24 ............................................................................................................................ 25 : ....................................................... 25 元件清單 .......................................................... 26 ............................................................... 27 4 1.緒論 由于單片機(jī)技術(shù)在各個(gè)領(lǐng)域正得到越來越廣泛的應(yīng)用,世界上許多集成電路生產(chǎn)廠家相繼推出了各種類型的單片機(jī),在單片機(jī)家族的眾多成員中 MCS52 系列單片機(jī)以其優(yōu)越的性能、成熟的技術(shù)及高可 靠性和高性能價(jià)格比,迅速占領(lǐng)了工業(yè)測(cè)控和自動(dòng)化工程應(yīng)用的主要市場(chǎng),成為國內(nèi)單片機(jī)應(yīng)用領(lǐng)域中的主流。本 畢業(yè) 設(shè)計(jì)主要在 STC89C52RC單片機(jī)上擴(kuò)展 I/O口, 復(fù)位電路,晶振電路, LED 顯示電路,數(shù)碼管顯示電路,蜂鳴器電路 。 學(xué)習(xí)單片機(jī)課程 以后,為了加深對(duì)理論知識(shí)的理解,加強(qiáng)理論知識(shí)在實(shí)際當(dāng)中的運(yùn)用,強(qiáng)化自己的動(dòng)手能力, 通過畢業(yè)設(shè)計(jì)(論文),提高學(xué)生綜合運(yùn)用所學(xué)知識(shí)來解決實(shí)際問題、使用文獻(xiàn)資料、及進(jìn)行科學(xué)實(shí)驗(yàn)或技術(shù)設(shè)計(jì)的初步能力,為畢業(yè)設(shè)計(jì)(論文)打基礎(chǔ) 。對(duì) 51 系列單片機(jī)來說 ,最小系統(tǒng)一般應(yīng)該包括 :單片機(jī)、晶振電路、復(fù)位電路、按鍵輸入、顯示輸出等。 晶振電 路 :典型的晶振取 (因?yàn)榭梢詼?zhǔn)確地得到 9600 波特率和19200 波特率 ,用于有串口通訊的場(chǎng)合 )同時(shí)也可取 12MHz(產(chǎn)生精確 的微秒 級(jí)時(shí)歇 ,方便定時(shí)操作 ),因設(shè)計(jì)需要,本設(shè)計(jì)采用 12M 晶振。 通過該最小系統(tǒng),我們可以用 keil 軟件進(jìn)行編程從而實(shí)現(xiàn)對(duì)一些外設(shè)的控制!比如一些簡(jiǎn)單的實(shí)驗(yàn):閃爍燈、跑 馬燈、數(shù)碼管和蜂鳴器的展示等等! 、 STC89C52RC 介紹 PDIP 封裝的 STC89C52引腳圖 STC89C52 為 8 位 通用微處理器 ,采用工業(yè)標(biāo)準(zhǔn)的 C51 內(nèi)核,在內(nèi)部功能及管腳排布上與通用的 8xc52 相同,其主要用于會(huì)聚調(diào)整時(shí)的功能控制。 VCC( 40 腳)和 VSS( 20 腳)為供電端 口,分別接 +5V 電源的正負(fù)端。 P0口作為地址 /數(shù)據(jù)分時(shí)復(fù)用總線時(shí),可分為兩種情況:一種是從 P0 口輸出地址或數(shù)據(jù),另一種是從 P0口輸入數(shù)據(jù)。在沒有外部擴(kuò)展存儲(chǔ)器時(shí), P0 口也可作為通用的 I/O 接口,但此時(shí)只是一個(gè)準(zhǔn)雙向 口。從功能上來講,即輸入輸出 I/O 接口,具有輸入、輸出、端口操作三種工作方式,每 1 位口線 能獨(dú)立地用作輸入 /輸出線。與AT89C51 相比, STC89C52RC 的 不同之處是, 和 除作為通用 I/O 接口線外,還具有第二功能,即 可作為定時(shí)器 /計(jì)數(shù)器 2的外部計(jì)數(shù)脈沖輸入端T2, 可作為定時(shí)器 /計(jì)數(shù)器 2 的外部控制輸入端 T2EX。在上述情況下,鎖存器的內(nèi)容不受影響,所以,取指或訪問外部存儲(chǔ)器結(jié)束后,由于轉(zhuǎn)換開關(guān)又接回鎖存器,使驅(qū)動(dòng)器與鎖存器 Q 端相連,引腳上將恢復(fù)原來的數(shù)據(jù)。當(dāng) P3 口作為通用 I/O 接口時(shí),第二功能輸出線為 高電平,使與非門 3的輸出取決于鎖存器的狀態(tài)。同樣, P3 口的每一位可獨(dú)立的定義為第一功能輸入輸出或第二功能輸入輸出。 RST 即 RESET,VPD 為備用電源,