【正文】
sfr WDTRST = 0xa6。 10% 4 24 電解電容 NOP50V100pF177。 20% 2 22 電解電容 105℃ 50V10uF177。 1% 2 20 電阻 177。 1% 5 18 電阻 177。The infrared ray will not reveal toward outdoors, will not produce a disturb of signal。 32 參 考 文 獻 [1]李魯群 . 編寫 Palm J2ME 紅外線 “ 聊天 ” 程序 . [2]李朝青. 1998.單片機原理及接口技術.北京:北京航空航天大學出版社; [3]李朝青 . .北京航空航天大學出版社; [4]李軍. 2022. 51系列單片機 高級實例開發(fā)指南.北京航空航天大學出版社; [5]全國大學生電子設計競賽組委會. 2022.全國大學生電子設計競賽獲獎作品選編( 2022).北京:北京理工大學出版社; [6]張文崢 ,李先亮 ,張其善等 . . 電子技術應用; [7]邱玉春 ,李文俊 . .電子產品世界; [8]楊將新,李華軍,劉到駿等. 2022.單片機程序設計及應用(從基礎到實踐).電子工業(yè)出版社; [9]周立功. 2022. LPC900 系列 Flash單片機應用技術,北京航空航天大學出版社; [10]周彥明 . 89C2051 系統(tǒng) .電子報; [11]黃耀軍 ,周云 ,嚴國萍等 . . 電子技術; [12]黃智偉. 2022.全國大學生電子設計競賽訓練教程.北京:電子工業(yè)出版社; [13]匿名 . PT2262 實現(xiàn)可遙控式電子密碼鎖 .電子設計應用; [14]薛宗祥,鹿樹理,朱惠英等. 1999. EPSON 8 位單片機原理與應用.北京航空航天大學出版社; [15]Intel corporation. 1981. MCS51(tm) family of single chip microputers: Users manual. Santa Clara: Intel Corporation [16]M Mizumoto. 1995. Realization of PID Controls by Fuzzy Control Methods. Fuzzy Sets and Systems [17]Serial Infrared Physical Layer Specification, Version . October 15,1998,IBM corporation ,HewlettPackard Company, Sharp Inc. [18]Link Management Protocol ,Version 23,1996,IBM Corporation. [19]Serial Infrared Link Access Protocol(IrLAP),Version . June 16, 1996,IBM Corporation , [20]HewlettPackard Company, Apple Computer, Inc., Counterpoint Systems Foundry, Inc. [21]AT24C01 datasheet. 33 The Device of Infrared Electronic Lock in Code Based on single chip Device Tang Jianguo (College of Engineering, South China Agricultural University Guangzhou 510640, China) Abstract: Along with the exaltation of social science and the living level of people, how carry out the family to guard against theft, this problem also change particularly of the simple construct of traditional machine lock,the affairs of theft is electronics lock is safer because of its confidentiality, using the vivid good, the safe coefficient is high, being subjected to the large customer close. The Infrared Electronic lock is a kind of to take the high strength password sequence as the foundation, on board the password switch that carry out in the single slice. It is the information medium with the Infrared, thus carrying out to control from a distance, can also provide with a structure simple contact type munication to connect, and hard to broken. This lock have the usage that convenience, operation simple, and the price cheap etc. so it can bring convenient to the our it is applicable to those special place where is damage of human body, for example high radiation area, high infection area etc. It can carry out the key information to register in the main on board initial attestation, the password information encrypt, the red unauthorized biography lose, and the key throws to lose to discard etc. Go to correspond by letter the principle according to the string between 51 machines, make use of infrared to deliver, this is easy to encrypt and protect to the passwords information the adoption is infrared from a distance outside opposite lock is have more advantage to the electronics bination lock that keyboard input in the machine. For example, infrared ray shoot equip adoption infrared diode, control from a distance shoot the machine is easy to make the production smaller and cheaper。衷心感謝我的舍友謝利洪 同學,感謝他給予我的幫助和支持。 感謝學校。如果沒有他們從小到大對我的培養(yǎng),就沒有這一切。理論知識還要鞏固加強。 在畢業(yè)設計過程中,鞏固了在大學 4年內學過的知識,尤其是單片機和模擬電子方面的知識,同時通過這次畢設提高了單片機編程的能力,尤其是獲得的軟件調試經驗,同時加強了我的實際編程能 力,同時也讓自己更加的知道了自己知識領域里的不足和缺陷。如經優(yōu)化設計,成本可以進一步降低。此產品還有其它優(yōu)點:功耗低,價格適中,體積??;而且可以通過修改單片機程序,從而使其功能不斷地增強與更新。在系統(tǒng)設計過程中,力求硬件線路簡單,充分發(fā)揮軟件片成方便靈活的特點,來滿足系統(tǒng)設計要求。 總結調試經驗,紅外通信只能工作于半雙工方式,同時,由于通信波特率比較低,編程時應注意等待時間。 用 51系列單片機的下載線將程序下載到單片機內,用串口 USB線來監(jiān)測發(fā)送和接收的數(shù)據,對照著來修改程序。 30 軟件調試 對于本系統(tǒng)而言,軟件程序所實現(xiàn)的功能比較多,所以軟件程序的調試顯得相當?shù)臒┈崱? 紅外遙控門鎖(主機)調試 調試時使用 串口 USBISP線一步步監(jiān)控單片機的紅外反射和接收信號是否符合要求,來進一步地調整個別電路??紤]到按鍵操作時間一般為幾十毫秒到幾秒,單片機復位時間僅為 200ms 左右,一般來得及輸出自鎖高電平。 硬件單元調試 紅外鑰匙(從機)調試 當按鍵按下后,系統(tǒng)上電,確保單片機能夠自鎖電子開關,維持電子開關的導通,系統(tǒng)正常供電。聯(lián)機調試是最重要的一部分,同時也是本裝置成功的關鍵。這樣有利于問題的分析和解決,不會造成問題的積累,而且不會因為一個小問題而進行整體電路的檢查,從而可以節(jié)約大量的調試時間。 表 5- 1 調試使用的儀器設備 序號 名稱、型號、規(guī)格 數(shù)量 備注 1 組裝兼容計算機 1 帶 2 個 9 針串口 2 直流穩(wěn)壓電源 2 5V 3 萬用表 1 4 串口調試 USB- ISP 線 1 5 Keil C51 單片機編譯 軟件 美國 Keil Software 公司 6 Proteus ISIS 仿真軟件 英國 Labcenter 公司 7 示波器 1 整體調試 本裝置的調試主要分為硬件調試、軟件調試等兩大部分。 26 圖 45 紅外鑰匙(從機)子系統(tǒng)軟件結構圖 紅外遙控門鎖(主機)子系統(tǒng)軟件結構設計 根據紅外遙控門鎖(主機)子系統(tǒng)的功能需求分析,以及紅外遙控門鎖子系統(tǒng)的硬件電路,設計紅外遙控門鎖子系統(tǒng)的軟件結構圖,如圖 45所示。 在數(shù)據接收過程中,如果發(fā)現(xiàn)相鄰的兩個脈沖的間隔不在允許的范圍內,則認為數(shù)據位有錯誤,此時將按接收幀錯誤處理 紅外數(shù)據接收模塊框圖如圖 4- 4所示。收到 8個數(shù)據后接收第一個停止位(必須是二進制數(shù) “1” ,否則認為是幀錯誤)。當紅外接收電路收到頻帶內信號時輸出一個負脈沖并觸發(fā) INT0,單片機響應中斷,先清零定時器 T0,啟動定時器 T0 定時,收到第二個脈沖時,讀出定時器 T0 的計數(shù)值并計算該脈沖信號與前一個脈沖信號之間的時間間隔,如為 500us,則收到一個二進制數(shù) “0” ,即起始位,否則繼續(xù)搜索起始位。考慮到發(fā)射器和接收器中斷響應的延遲以及接收器信 24 號接收延遲的影響,接收器允許脈沖的間隔最大誤差為 100us,即二進制數(shù)位 “0” 的脈沖串有效間隔范圍為 400us~ 600us,即二進制數(shù)位 “1” 的脈沖串有效間隔范圍為900us~ 1100us,不在此范圍內的脈沖串被認為是干擾信號或誤碼。定時器用于測量兩個脈沖串之間的時間間隔,設定工作于方式 1,定時常數(shù)為零,每次啟動測量前,定時器均清零