【文章內(nèi)容簡(jiǎn)介】
延時(shí)子程序 === DELY10MS: MOV R6,10 D1: MOV R7,248 DJNZ R7,$ DJNZ R6,D1 RET 中斷服務(wù)子程序 。==== 中斷服務(wù)子程序 === INT_T0: MOV TH0,STH0 MOV TL0,STL0 CPL RETI 武漢紡織大學(xué) 2020 屆畢業(yè)設(shè)計(jì)論文 23 音符參數(shù)表 。==== 音符參數(shù)表 === TABLE: DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H DB 7FH,6FH,77H,7CH,39H,5EH,79H,71H 計(jì)數(shù)器初值表 。==== 計(jì)數(shù)器初值表 == TABLE1: DW 64021,64103,64260,64400 DW 64524,64580,64684,64777 DW 64820,64898,64968,65030 DW 65058,65110,65157,65178 預(yù)存歌曲表 。=== 預(yù)存歌曲表 === TABLE2: DW 2202H,2902H,2902H,2902H,2906H,2702H 。 DW 2502H,2702H,2502H,2402H,2208H 。 DW 2E02H,2E02H,2E02H,2E02H,2E06H,2C02H 。 DW 2902H,2C02H,2D02H,2A02H,2908H 。 DW 2902H,2E02H,2E02H,2C02H,2906H,2702H 。 DW 2502H,2702H,2502H,2402H,2206H,1D02H 。 DW 1D02H,2502H,2502H,2402H,2206H,2902H 。 DW 2702H,2502H,2402H,2020H,2208H 。 DW 0000H 。 END 4 結(jié) 束 語(yǔ) 單片機(jī)作為一門軟硬件相結(jié)合的學(xué)科,讓許多像我這樣的非電子專業(yè)的學(xué)生武漢紡織大學(xué) 2020 屆畢業(yè)設(shè)計(jì)論文 24 頭疼不已。起初,我也屬于一個(gè)比較“怕硬”的計(jì)算機(jī)學(xué)生,由于大一大二的數(shù)電模電沒(méi)學(xué)好,所以一提到硬件方面的東 西,我就覺(jué)得頭疼。最初聽(tīng)余老師講的單片機(jī)的課的時(shí)候,屬于余老師每問(wèn)必倒的學(xué)生之一。因此,最初對(duì)于這門課并沒(méi)有多少興趣。最初從指令系統(tǒng),尋址方式,到單片機(jī)的內(nèi)部資源,一點(diǎn)概念都沒(méi)有。雖然每次課都看著大屏幕,聽(tīng)著老師講課,但還是覺(jué)得整門課聽(tīng)的比較吃力。我覺(jué)得單片機(jī)作為微型計(jì)算機(jī)的一種,必然和計(jì)算機(jī)有一定的共性。后來(lái)有一段時(shí)間,我在課余的時(shí)間去旁聽(tīng)了幾堂韓建民老師的《計(jì)算機(jī)組成原理》,對(duì)計(jì)算機(jī)的指令系統(tǒng)和尋址方式有了點(diǎn)認(rèn)識(shí),再回過(guò)頭來(lái)看單片機(jī)的指令系統(tǒng)的時(shí)候覺(jué)得慢慢的有頭緒了,不再像原先那樣摸不著頭腦。實(shí)驗(yàn)課做實(shí) 驗(yàn)的時(shí)候也不再像之前那樣呆在實(shí)驗(yàn)室不知道該干什么。當(dāng)我第一次在試驗(yàn)儀上成功的調(diào)試出三角波的程序,看到示波器上的三角波圖形,突然覺(jué)得單片機(jī)也是蠻有意思的,那種感覺(jué)就像第一次用 CFREE 第一次在計(jì)算機(jī)上編寫(xiě)出第一個(gè)“ Hello world”程序一樣。之后也就開(kāi)始慢慢加緊補(bǔ)前面落下的知識(shí)。到要做課程設(shè)計(jì)的時(shí)候,發(fā)現(xiàn)依然學(xué)到用時(shí)方恨少,到圖書(shū)館里借書(shū),上網(wǎng)查資料,費(fèi)了不少勁才完成這次課程設(shè)計(jì),雖然做的蠻吃力的,但通過(guò)這次課程設(shè)計(jì)我比較好的對(duì)指令系統(tǒng),內(nèi)部資源和人機(jī)交互的知識(shí)大體復(fù)習(xí)了一遍,發(fā)現(xiàn)了不少缺漏,很好的補(bǔ) 缺補(bǔ)漏了一遍。因?yàn)槠綍r(shí)時(shí)間沒(méi)合理的安排和利用,課程設(shè)計(jì)到了最后這一周才完成,可能有不少缺漏或者錯(cuò)誤,希望老師加以批評(píng)指正。在此,我要對(duì)要求我們做這次課程設(shè)計(jì)的余老師致以衷心的感謝,因?yàn)橛嗬蠋熃o了我一次難得的鍛煉的機(jī)會(huì)。最后,我還要感謝韓建民老師和電子 071 的張琦同學(xué),他們?cè)啻尾粎捚錈┑貫槲医獯鹆瞬簧僖苫?,使我在?duì)指令系統(tǒng)的理解上少走了不少?gòu)澛贰? 武漢紡織大學(xué) 2020 屆畢業(yè)設(shè)計(jì)論文 25 參考文獻(xiàn) [1] 張?chǎng)?,華臻 ,陳書(shū)謙 .單片機(jī)原理與應(yīng)用 .[M].電子工業(yè)出版社, [2] 肖婧 .單片入門與趣味實(shí)驗(yàn)設(shè)計(jì) [M].北京航空航天大學(xué)出版社, [3] 陳明熒 .8051 單片機(jī)課程設(shè)計(jì)實(shí)訓(xùn)教材 [M].清華大學(xué)出版社, [4] 趙建領(lǐng) .51 系列單片機(jī)開(kāi)發(fā)寶典 [M].電子工業(yè)出版社, [5] 求是科技 .8051 系列單片機(jī) C 程序設(shè)計(jì)完全手冊(cè) [M].人民郵電出版社, [6] 樓然苗 ,李光飛 .51系列單片機(jī)設(shè)計(jì)實(shí)例 [M].北京航空航天大學(xué)出版社 , [7] 侯媛彬等,凌陽(yáng)單片機(jī)原理及其畢業(yè)設(shè)計(jì)精選 2020 年,科學(xué)出版社 [8] 羅亞非,凌陽(yáng)十六位單片機(jī)應(yīng)用基礎(chǔ) 2020 年 北京航空航天大學(xué)出版社 [9] 北京北陽(yáng)電子有限公司, 061A 凌陽(yáng)單片機(jī)及其附帶光盤 2020 年 [10]張毅剛等, MCS51 單片機(jī)應(yīng)用設(shè)計(jì),哈工大出版社, 2020 年第 2版 [11]霍孟友等,單片機(jī)原理與應(yīng)用,機(jī)械工業(yè)出版社, [12]霍孟友等,單片機(jī)原理與應(yīng)用學(xué)習(xí)概要及題解,機(jī)械工業(yè)出版社, [13]許泳龍等,單片機(jī)原理及應(yīng)用,機(jī)械工業(yè)出版社, 武漢紡織大學(xué) 2020 屆畢業(yè)設(shè)計(jì)論文 26 外文資料 Description The AT89C51 is a lowpower, highperformance CMOS 8bit microputer with 4K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmel’s highdensity nonvolatile memory technology and is patible with the industrystandard MCS51 instruction set and pinout. The onchip Flash allows the program memory to be reprogrammed insystem or by a conventional nonvolatile memory programmer. By bining a versatile 8bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microputer which provides a highlyflexible and costeffective solution to many embedded control applications. Function characteristic The AT89C51 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16bit timer/counters, a five vector twolevel interrupt architecture, a full duplex serial port, onchip oscillator and clock circuitry. In addition, the AT89C51 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The Powerdown Mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset. Pin Description VCC: Supply voltage. GND: Ground. Port 0: Port 0 is an 8bit opendrain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as highimpedance 0 may also be configured to be the multiplexed loworder 武漢紡織大學(xué) 2020 屆畢業(yè)設(shè)計(jì)論文 27 address/data bus during accesses to external program and data memory. In this mode P0 has internal 0 also receives the code bytes during Flash programming,and outputs the code bytes during programverification. External pullups are required during programverification. Port 1 Port 1 is an 8bit bidirectional I/O port with internal Port 1 output buffers can sink/source four TTL 1s are written to Port 1 pins they are pulled high by the internal pullups and can be used as inputs. As inputs,Port 1 pins that are externally being pulled low will source current (IIL) because of the internal 1 also receives the loworder address bytes during Flash programming and verification. Port 2 Port 2 is an 8bit bidirectional I/O port with internal Port 2 output buffers can sink/source four TTL 1s are written to Port 2 pins they are pulled high by the internal pullups and can be used as inputs. As inputs,Port 2 pins that are externally being pulled low will source current, because of the internal 2 emits the highorder address byte during fetches from external program memory and during accesses to external data memory that use 16bit addresses. In this application, it uses strong internal pullupswhen emitting 1s. During accesses to external data memory that use 8bit addresses, Port 2 emits the contents of the P2 Special Function 2 also receives the highorder address bits and some control signals during Flash programming and verification. Port 3 Port 3 is an 8bit bidirectional I/O port with internal Port 3 output buffers can sink/source four TTL 1s are written to Port 3 pins they are pulled high by the internal pullups and can be used as inputs.