【正文】
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 參 考 文 獻(xiàn) [1]李魯群 . 編寫 Palm J2ME 紅外線 “ 聊天 ” 程序 . [2]李朝青. 1998.單片機(jī)原理及接口技術(shù).北京:北京航空航天大學(xué)出版社; [3]李朝青 . .北京航空航天大學(xué)出版社; [4]李軍. 2022. 51系列單片機(jī) 高級實(shí)例開發(fā)指南.北京航空航天大學(xué)出版社; [5]全國大學(xué)生電子設(shè)計(jì)競賽組委會. 2022.全國大學(xué)生電子設(shè)計(jì)競賽獲獎(jiǎng)作品選編( 2022).北京:北京理工大學(xué)出版社; [6]張文崢 ,李先亮 ,張其善等 . . 電子技術(shù)應(yīng)用; [7]邱玉春 ,李文俊 . .電子產(chǎn)品世界; [8]楊將新,李華軍,劉到駿等. 2022.單片機(jī)程序設(shè)計(jì)及應(yīng)用(從基礎(chǔ)到實(shí)踐).電子工業(yè)出版社; [9]周立功. 2022. LPC900 系列 Flash單片機(jī)應(yīng)用技術(shù),北京航空航天大學(xué)出版社; [10]周彥明 . 89C2051 系統(tǒng) .電子報(bào); [11]黃耀軍 ,周云 ,嚴(yán)國萍等 . . 電子技術(shù); [12]黃智偉. 2022.全國大學(xué)生電子設(shè)計(jì)競賽訓(xùn)練教程.北京:電子工業(yè)出版社; [13]匿名 . PT2262 實(shí)現(xiàn)可遙控式電子密碼鎖 .電子設(shè)計(jì)應(yīng)用; [14]薛宗祥,鹿樹理,朱惠英等. 1999. EPSON 8 位單片機(jī)原理與應(yīng)用.北京航空航天大學(xué)出版社; [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。衷心感謝我的舍友謝利洪 同學(xué),感謝他給予我的幫助和支持。 感謝學(xué)校。如果沒有他們從小到大對我的培養(yǎng),就沒有這一切。理論知識還要鞏固加強(qiáng)。 在畢業(yè)設(shè)計(jì)過程中,鞏固了在大學(xué) 4年內(nèi)學(xué)過的知識,尤其是單片機(jī)和模擬電子方面的知識,同時(shí)通過這次畢設(shè)提高了單片機(jī)編程的能力,尤其是獲得的軟件調(diào)試經(jīng)驗(yàn),同時(shí)加強(qiáng)了我的實(shí)際編程能 力,同時(shí)也讓自己更加的知道了自己知識領(lǐng)域里的不足和缺陷。如經(jīng)優(yōu)化設(shè)計(jì),成本可以進(jìn)一步降低。此產(chǎn)品還有其它優(yōu)點(diǎn):功耗低,價(jià)格適中,體積??;而且可以通過修改單片機(jī)程序,從而使其功能不斷地增強(qiáng)與更新。在系統(tǒng)設(shè)計(jì)過程中,力求硬件線路簡單,充分發(fā)揮軟件片成方便靈活的特點(diǎn),來滿足系統(tǒng)設(shè)計(jì)要求。 總結(jié)調(diào)試經(jīng)驗(yàn),紅外通信只能工作于半雙工方式,同時(shí),由于通信波特率比較低,編程時(shí)應(yīng)注意等待時(shí)間。 用 51系列單片機(jī)的下載線將程序下載到單片機(jī)內(nèi),用串口 USB線來監(jiān)測發(fā)送和接收的數(shù)據(jù),對照著來修改程序。 30 軟件調(diào)試 對于本系統(tǒng)而言,軟件程序所實(shí)現(xiàn)的功能比較多,所以軟件程序的調(diào)試顯得相當(dāng)?shù)臒┈崱? 紅外遙控門鎖(主機(jī))調(diào)試 調(diào)試時(shí)使用 串口 USBISP線一步步監(jiān)控單片機(jī)的紅外反射和接收信號是否符合要求,來進(jìn)一步地調(diào)整個(gè)別電路??紤]到按鍵操作時(shí)間一般為幾十毫秒到幾秒,單片機(jī)復(fù)位時(shí)間僅為 200ms 左右,一般來得及輸出自鎖高電平。 硬件單元調(diào)試 紅外鑰匙(從機(jī))調(diào)試 當(dāng)按鍵按下后,系統(tǒng)上電,確保單片機(jī)能夠自鎖電子開關(guān),維持電子開關(guān)的導(dǎo)通,系統(tǒng)正常供電。聯(lián)機(jī)調(diào)試是最重要的一部分,同時(shí)也是本裝置成功的關(guān)鍵。這樣有利于問題的分析和解決,不會造成問題的積累,而且不會因?yàn)橐粋€(gè)小問題而進(jìn)行整體電路的檢查,從而可以節(jié)約大量的調(diào)試時(shí)間。 表 5- 1 調(diào)試使用的儀器設(shè)備 序號 名稱、型號、規(guī)格 數(shù)量 備注 1 組裝兼容計(jì)算機(jī) 1 帶 2 個(gè) 9 針串口 2 直流穩(wěn)壓電源 2 5V 3 萬用表 1 4 串口調(diào)試 USB- ISP 線 1 5 Keil C51 單片機(jī)編譯 軟件 美國 Keil Software 公司 6 Proteus ISIS 仿真軟件 英國 Labcenter 公司 7 示波器 1 整體調(diào)試 本裝置的調(diào)試主要分為硬件調(diào)試、軟件調(diào)試等兩大部分。 26 圖 45 紅外鑰匙(從機(jī))子系統(tǒng)軟件結(jié)構(gòu)圖 紅外遙控門鎖(主機(jī))子系統(tǒng)軟件結(jié)構(gòu)設(shè)計(jì) 根據(jù)紅外遙控門鎖(主機(jī))子系統(tǒng)的功能需求分析,以及紅外遙控門鎖子系統(tǒng)的硬件電路,設(shè)計(jì)紅外遙控門鎖子系統(tǒng)的軟件結(jié)構(gòu)圖,如圖 45所示。 在數(shù)據(jù)接收過程中,如果發(fā)現(xiàn)相鄰的兩個(gè)脈沖的間隔不在允許的范圍內(nèi),則認(rèn)為數(shù)據(jù)位有錯(cuò)誤,此時(shí)將按接收幀錯(cuò)誤處理 紅外數(shù)據(jù)接收模塊框圖如圖 4- 4所示。收到 8個(gè)數(shù)據(jù)后接收第一個(gè)停止位(必須是二進(jìn)制數(shù) “1” ,否則認(rèn)為是幀錯(cuò)誤)。當(dāng)紅外接收電路收到頻帶內(nèi)信號時(shí)輸出一個(gè)負(fù)脈沖并觸發(fā) INT0,單片機(jī)響應(yīng)中斷,先清零定時(shí)器 T0,啟動(dòng)定時(shí)器 T0 定時(shí),收到第二個(gè)脈沖時(shí),讀出定時(shí)器 T0 的計(jì)數(shù)值并計(jì)算該脈沖信號與前一個(gè)脈沖信號之間的時(shí)間間隔,如為 500us,則收到一個(gè)二進(jìn)制數(shù) “0” ,即起始位,否則繼續(xù)搜索起始位??紤]到發(fā)射器和接收器中斷響應(yīng)的延遲以及接收器信 24 號接收延遲的影響,接收器允許脈沖的間隔最大誤差為 100us,即二進(jìn)制數(shù)位 “0” 的脈沖串有效間隔范圍為 400us~ 600us,即二進(jìn)制數(shù)位 “1” 的脈沖串有效間隔范圍為900us~ 1100us,不在此范圍內(nèi)的脈沖串被認(rèn)為是干擾信號或誤碼。定時(shí)器用于測量兩個(gè)脈沖串之間的時(shí)間間隔,設(shè)定工作于方式 1,定時(shí)常數(shù)為零,每次啟動(dòng)測量前,定時(shí)器均清零