I2C-24C04與蜂鳴器課程設計說明書_第1頁
I2C-24C04與蜂鳴器課程設計說明書_第2頁
I2C-24C04與蜂鳴器課程設計說明書_第3頁
I2C-24C04與蜂鳴器課程設計說明書_第4頁
I2C-24C04與蜂鳴器課程設計說明書_第5頁
已閱讀5頁,還剩10頁未讀 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、evaluation of scientific development. Nature security type-nature security is to maintenance people of health value for target, through strengthening security based management, and risk management, and equipment management and technology supervision, ensure production in the people, and real, and sy

2、stem, and system, elements security reliable, and harmony unified, full control various against factors, achieved thought no slack, and management no empty document, and equipment no hidden, and system no blocked, and unit zero non-stopped. Quality and efficiency-quality benefit is to adhere to the

3、enterprise "survival, profit and development" business truth, adhere to the "all activity is economic activity, all costs can be controlled, money should not be wasted" management philosophy, management analysis, to improve management quality, improve cost control capacity and ma

4、rket competitiveness. Innovation of science and technology-science and technology innovation is to play the role of science and technology as the primary productive force, active use of new technologies, new materials, new processes, new equipment, increase investment in science and technology, stre

5、ngthening scientific and technological training, speeding up transforming scientific and technological achievements, forming a number of proprietary technology, enhancing core competitiveness. Resource-saving-the-resources saving enterprise was to reduce coal consumption, water consumption, electric

6、ity at the core, enhance the operation of lean management to realize low consumption, high efficiency, reduce production costs. Second is to strengthen the business, financial, material, information and the optimization of organization and management, saving the internal transaction costs. Harmoniou

7、s development of harmonious development-is to construct a "foreign" environment for development. "XING" refers to the "internal security firm and internal management of the internal management measures are effective, harmonious". "Foreign currency" means "

8、;Enterprise coordinating development of homeopathy, well, get along with the neighbors better." (B) XX 2013 five enterprises building intrinsic safety power company goals are: unplanned outage 0 times. Class of disorders 0, 0 is equivalent forced outage rate. No personal injury accident, materi

9、al and equipment accidents do not occur, no fire, no environmental pollution accident. Enterprise integrated to achieve zero cases of violation, zero accidents, zero. Quality goal is: when generating capacity 7.5 billion-kilowatt, sales of over 7.11 billion kWh, total profits of 306.6 million Yuan,

10、. BFS+、PI、MIS、SCM Information systems infrastructure, fully integrated information system to realize information resources sharing; to expand the breadth and depth of the portal system, information system of Enterprise Management Assistant role to play; to improve the day-to-day operation and mainte

11、nance operation record of promoting causes and transfer system; to strengthen the training目 錄第一章課程設計的目的-3第二章元器件介紹-32.1 芯片引腳功能圖-32.2 元器件清單-6 第3章 硬件設計-63.1蜂鳴器放大電路-63.2系統硬件設計圖-73.3 焊接電路板-7第四章軟件設計-114.1程序設計-11參考文獻-14設計小結-15第一章課程設計的目的程序運行后會首先將14個音符索引字節寫入24C04,然后再反復讀取這些音符并演奏。第二章元器件介紹2.1 芯片引腳功能圖2.1.1 單片機的基

12、本組成時鐘電路SFR和RAMROMCPU定時/計數器并行端口中斷系統串行端口系 統 總 線時鐘源T0 T1P0 P1 P2 P3TXD RXD INT0 INT1圖2.1單片機基本組成圖(1)一個8位微處理器CPU。(2)數據存儲器RAM和特殊功能寄存器SFR。(3)內部程序存儲器ROM。(4)兩個定時/計數器,用以對外部事件進行計數,也可用作定時器。(5)四個8位可編程的I/O(輸入/輸出)并行端口,每個端口既可做輸入,也可做輸出。(6)一個串行端口,用于數據的串行通信。(7)中斷控制系統。(8)內部時鐘電路。STC89C51引腳圖2.1.2 24C04A芯片(起存儲功能)1 82 73 6

13、 4 5 A0 VCC A1 WP A2 SCL GND SDA A0-A2 地址輸入線SDA 串行輸入/輸出線SCL 串行時鐘輸入線WP 寫保護線(或空腳NC)VCC 供電電源線GND 接地線2.1.3 MAX232(電壓轉換器) C1+ VCC V+ GND C1- T1OUT C2+ R11N C2- R1OUT V- T11N T2OUT T21N R21N R2OUT2.2 元器件清單元件名稱圖紙上的編號參數或備注數量電阻R110K2電容C1,C222pF2C310uF5晶振X112M1單片機STC89C52124C04A1蜂鳴器1MAX2321串口1萬用本1USB延長線1自鎖開關1

14、三極管1導線若干40P IC鎖緊插座1第3章 硬件設計3.1蜂鳴器放大電路 5V 10K P3.0 3.2系統硬件設計圖3.3焊接電路板第四章軟件設計4.1程序設計 #include<reg51.h>#include<intrins.h>#define uchar unsigned char#define uint unsigned int#define NOP4() _nop_();_nop_();_nop_();_nop_();sbit SCL=P10;sbit SDA=P11;sbit SPK=P30;/標準音符頻率對應的延時表uchar code HI_LIST

15、=0,226,229,232,233,236,238,240,241,242,244,245,246,247,248;uchar code LO_LIST=0,4,13,10,20,3,8,6,2,23,5,26,1,4,3;/待寫入24C04的音符uchar code Song_24C04=1,2,3,1,1,2,3,1,3,4,5,3,4,5;uchar sidx;/讀取音符索引/延時void DelayMS(uint ms)uchar i;while(ms-) for(i=0;i<120;i+);/IIC開始void Start()SDA=1;SCL=1;NOP4();SDA=0;

16、NOP4();SCL=0;/IIC停止void Stop()SDA=0;SCL=0;NOP4();SCL=1;NOP4();SDA=1; /讀取應答void RACK()SDA=1;NOP4();SCL=1;NOP4();SCL=0;/發送非應答信號void NO_ACK()SDA=1;SCL=1;NOP4();SCL=0;SDA=0;/向24C04中寫一個字節數據void Write_A_Byte(uchar b)uchar i;for(i=0;i<8;i+)b<<=1;SDA=CY;_nop_();SCL=1;NOP4();SCL=0;RACK();/向指定地址寫數據vo

17、id Write_IIC(uchar addr,uchar dat)Start();Write_A_Byte(0xa0);Write_A_Byte(addr);Write_A_Byte(dat);Stop();DelayMS(10);/從24C04中讀一個字節數據uchar Read_A_Byte()uchar i,b;for(i=0;i<8;i+)SCL=1;b<<=1;b|=SDA;SCL=0;return b;/從當前地址讀取數據uchar Read_Current()uchar d;Start();Write_A_Byte(0xa1);d=Read_A_Byte();

18、NO_ACK();Stop();return d;/從任意地址讀取數據uchar Random_Read(uchar addr)Start();Write_A_Byte(0xa0);Write_A_Byte(addr);Stop();return Read_Current();/定時器0中斷void T0_INT() interrupt 1SPK=SPK;TH0=HI_LISTsidx;TL0=LO_LISTsidx;/主程序void main()uint i;IE=0x82;TMOD=0x00;for(i=0;i<14;i+) /向24C04寫入音符表Write_IIC(i,Song_

19、24C04i);while(1) /反復讀取音符并播放for(i=0;i<15;i+)/從24C04中讀取音符sidx=Random_Read(i);/從指定地址讀取TR0=1;/播放DelayMS(300);參考文獻1孫涵芳.MCS-51/96系列 單片機原理及應用(修訂版).北京航空航天大學出版社.1994 2李朝青.單片機原理及接口技術(第3版).北京航空航天大學出版社.20053周潤景、袁偉亭、景曉松.Proteus在MCS-51&ARM7系統中的應用百例.電子工業出版社.2006設計小結課程設計是培養我們綜合運用所學知識發現、分析、解決實際問題,鍛煉實踐能力的重要環節,

20、是對我們實際工作能力具體訓練和考察過程。隨著科學技術的日新月異,單片機已經成為當今計算機應用中空前活躍的領域,在生活中可以說是無處不在。單片機在汽車電子領域的應用同樣十分廣泛,例如發動機控制器、基于CAN總線的汽車發動機智能電子控制器、GPS導航系統、ABS防抱死系統、防盜系統等等。因此,做好單片機課程設計能為我們汽車專業的學生以后工作提供幫助。通過兩周的課程設計,我對單片機有了更深的體會,了解和掌握了一些編程思想和對I/O口的使用。以及讓我學會了如何用串口燒程序。過程當中最印象深刻的是如何檢查電路。調試的過程中或多或少總有些問題,在解決問題的同時學會檢查自己的電路。像我的蜂鳴器,雖然整個電路

21、弄好了,但蜂鳴器的聲音很微弱,通過再連接一個放大電路才算把聲音調整過來。在最后的整體試驗中,我們嘗到了成功的喜悅,我們的工夫總算沒有白費。 在這里,我衷心地感謝我們的指導老師范老師,我們的成功與他的悉心指導是分不開的。 這次的課程設計讓我把單片機的理論知識用在實踐中,實現了理論和實踐相結合,從中更懂得理論的是實踐的基礎,實踐有能檢驗理論的正確性,讓我受益匪淺,對我以后參加工作或者繼續學習將會產生巨大的幫助和影響。supervision in large and medium goods vehicle. A is established large vehicles and small veh

22、icles classification management of motor vehicle test mode, increased medium van car, and dangerous goods transport car, and school car test project; II is established motor vehicle test regulatory platform, achieved motor vehicle test full process video, and data remote regulatory; three is strictl

23、y motor vehicle identification management, equipped with unified of identification equipment and tool, using mobile identification Terminal, and law enforcement records instrument, technology identification means. As to 20XX years June 20 statewide motor vehicle keep volume for 567,408 car, and last

24、 year earlier than growth 75,814 car, growth 13.36%; this year January-June, vehicles management section and license archives management section total accepted the motor vehicle registration business 42,543 car times, which registered registration 6,905 car times, and transfer registration 3,592 car

25、 times, and change registration 1033 car times, and mortgage registration 696 car times, and cancellation registration 187 car times, and into business 980 car times, and Archives corrections 81 pieces times, and issued test qualified logo 25,429 car times, and other vehicles business 3,640 car time

26、s; supervision Survey Section relies on "motor vehicle detection remote issued test qualified logo software platform" supervision motor vehicle test, and identification situation 7418l liangci, investigation motor vehicle exception business 30 car times, his pards business warning 244 arti

27、cle, vehicles and driving people sound video regulatory screenshots 1852 Zhang, checks motor vehicle archives 716 pieces times, and medium bus, and medium above truck, and Of hazardous chemicals, vehicles and school buses and other key vehicle inspection record of 420. (C) based on their own, and st

28、rict adherence to defense, more cheating, false false fugitive suspects, robbery suspect vehicles and the Internet crackdown. DMV full play to the "first line of Defense" position control, investigating cheating, fake identification and robbery suspect vehicles through operational work, and carefu

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論