【文章內(nèi)容簡介】
延時子程序 === 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è)計論文 23 音符參數(shù)表 。==== 音符參數(shù)表 === TABLE: DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H DB 7FH,6FH,77H,7CH,39H,5EH,79H,71H 計數(shù)器初值表 。==== 計數(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é) 束 語 單片機作為一門軟硬件相結(jié)合的學(xué)科,讓許多像我這樣的非電子專業(yè)的學(xué)生武漢紡織大學(xué) 2020 屆畢業(yè)設(shè)計論文 24 頭疼不已。起初,我也屬于一個比較“怕硬”的計算機學(xué)生,由于大一大二的數(shù)電模電沒學(xué)好,所以一提到硬件方面的東 西,我就覺得頭疼。最初聽余老師講的單片機的課的時候,屬于余老師每問必倒的學(xué)生之一。因此,最初對于這門課并沒有多少興趣。最初從指令系統(tǒng),尋址方式,到單片機的內(nèi)部資源,一點概念都沒有。雖然每次課都看著大屏幕,聽著老師講課,但還是覺得整門課聽的比較吃力。我覺得單片機作為微型計算機的一種,必然和計算機有一定的共性。后來有一段時間,我在課余的時間去旁聽了幾堂韓建民老師的《計算機組成原理》,對計算機的指令系統(tǒng)和尋址方式有了點認識,再回過頭來看單片機的指令系統(tǒng)的時候覺得慢慢的有頭緒了,不再像原先那樣摸不著頭腦。實驗課做實 驗的時候也不再像之前那樣呆在實驗室不知道該干什么。當(dāng)我第一次在試驗儀上成功的調(diào)試出三角波的程序,看到示波器上的三角波圖形,突然覺得單片機也是蠻有意思的,那種感覺就像第一次用 CFREE 第一次在計算機上編寫出第一個“ Hello world”程序一樣。之后也就開始慢慢加緊補前面落下的知識。到要做課程設(shè)計的時候,發(fā)現(xiàn)依然學(xué)到用時方恨少,到圖書館里借書,上網(wǎng)查資料,費了不少勁才完成這次課程設(shè)計,雖然做的蠻吃力的,但通過這次課程設(shè)計我比較好的對指令系統(tǒng),內(nèi)部資源和人機交互的知識大體復(fù)習(xí)了一遍,發(fā)現(xiàn)了不少缺漏,很好的補 缺補漏了一遍。因為平時時間沒合理的安排和利用,課程設(shè)計到了最后這一周才完成,可能有不少缺漏或者錯誤,希望老師加以批評指正。在此,我要對要求我們做這次課程設(shè)計的余老師致以衷心的感謝,因為余老師給了我一次難得的鍛煉的機會。最后,我還要感謝韓建民老師和電子 071 的張琦同學(xué),他們曾多次不厭其煩地為我解答了不少疑惑,使我在對指令系統(tǒng)的理解上少走了不少彎路。 武漢紡織大學(xué) 2020 屆畢業(yè)設(shè)計論文 25 參考文獻 [1] 張鑫 ,華臻 ,陳書謙 .單片機原理與應(yīng)用 .[M].電子工業(yè)出版社, [2] 肖婧 .單片入門與趣味實驗設(shè)計 [M].北京航空航天大學(xué)出版社, [3] 陳明熒 .8051 單片機課程設(shè)計實訓(xùn)教材 [M].清華大學(xué)出版社, [4] 趙建領(lǐng) .51 系列單片機開發(fā)寶典 [M].電子工業(yè)出版社, [5] 求是科技 .8051 系列單片機 C 程序設(shè)計完全手冊 [M].人民郵電出版社, [6] 樓然苗 ,李光飛 .51系列單片機設(shè)計實例 [M].北京航空航天大學(xué)出版社 , [7] 侯媛彬等,凌陽單片機原理及其畢業(yè)設(shè)計精選 2020 年,科學(xué)出版社 [8] 羅亞非,凌陽十六位單片機應(yīng)用基礎(chǔ) 2020 年 北京航空航天大學(xué)出版社 [9] 北京北陽電子有限公司, 061A 凌陽單片機及其附帶光盤 2020 年 [10]張毅剛等, MCS51 單片機應(yīng)用設(shè)計,哈工大出版社, 2020 年第 2版 [11]霍孟友等,單片機原理與應(yīng)用,機械工業(yè)出版社, [12]霍孟友等,單片機原理與應(yīng)用學(xué)習(xí)概要及題解,機械工業(yè)出版社, [13]許泳龍等,單片機原理及應(yīng)用,機械工業(yè)出版社, 武漢紡織大學(xué) 2020 屆畢業(yè)設(shè)計論文 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è)計論文 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.