【正文】
西南科技大學(xué)本科生畢業(yè)論文 I 基于單片機(jī)的電子密碼鎖設(shè)計(jì) 摘要: 鎖,是指加在門(mén)、箱子、抽屜等物體上的封緘器,要用專用的鑰匙才能打開(kāi)。自古以來(lái)鎖都是人們財(cái)產(chǎn)安全乃至生命安全的一種重要保障。伴隨著人類歷史的發(fā)展和人們對(duì)自身財(cái)產(chǎn)安全和人生安全的重視,各種各樣的多功能的鎖具也相繼出現(xiàn),人們使用的鎖具也由傳統(tǒng)的機(jī)械式鎖逐漸發(fā)展為安全性能更好,功能更多的電子密碼鎖。 在現(xiàn)代社會(huì),電子密碼鎖已是一個(gè)被大家所熟識(shí)的名詞。相信很多人的小區(qū)大門(mén)上的鎖都用的是電子密碼鎖。本文中將要介紹的電子密碼鎖是一種通過(guò)判斷密碼輸入是否正確來(lái)控制電路或是芯片的工作狀態(tài),進(jìn) 而控制鎖的打開(kāi)和閉合,從而完成開(kāi)鎖、閉鎖任務(wù)的電子鎖裝置。 本設(shè)計(jì)是基于 AT89C51 單片機(jī) 為控制核心 的密碼鎖設(shè)計(jì)方案 。 在本次基于單片機(jī)的電子密碼鎖設(shè)計(jì)中,將采用 AT89C51 單片機(jī)作為控制核心,配合相應(yīng)的電路和軟件程序,實(shí)現(xiàn)密碼的輸入和修改、信息的顯示、鍵盤(pán)的鎖定、系統(tǒng)報(bào)警、開(kāi)鎖和閉鎖等功能。在設(shè)計(jì)中, 利用識(shí)別密碼是否正確來(lái)開(kāi)鎖或報(bào)警,通過(guò)串行存儲(chǔ)器 AT24C02 來(lái)實(shí)現(xiàn)密碼的修改和存儲(chǔ)。 本文設(shè)計(jì)的 密碼鎖具有安全性高、功耗低、操作簡(jiǎn)單等優(yōu)點(diǎn)。 關(guān)鍵詞 :單片機(jī);密碼鎖;電子鎖;矩陣鍵盤(pán);掉電存儲(chǔ) 西南科技大學(xué)本科生畢業(yè)論文 II The Design Of Electronic Code Lock Based On Single Chip Microputer Abstract: As sealed device, the lock added to such objects like door, box, drawer etc, can be opened with specified key. Since the ancient time, lock is a kind of security, guaranteeing people?s property safety even life safety. With the development of human history and more attention paid to property safety and life safety, various multifunctional locks can be seen in the world. Traditional mechanical locks people use in life are gradually replaced by electronic bination lock characterized with better safety performance and more functions. In the modern society, electronic bination lock is a noun familiar to everyone. Usually, the door of munity is equipped with electronic bination lock. This paper will introduce an electronic bination lock. This lock controls the electric circuits and the performance of chips by identifying password. Thus, the openness and closeness of the lock can be controlled, and the task of electronic lock device can be pleted. This design is about bination lock, based on the AT89C51 singlechip microputer as the core of controlling goals. This design in which the AT89C51 singlechip microputer as the core of the controlling goals cooperated with relevant circuits and software programs can achieve such functions like password input and modification, information display, keyboard locking, warning system, and the openness and closeness of the lock etc. In this design, the openness of lock and alarming are according to identifying the password, and password revision and storage is achieved by the function of the AT24C02 serial storage. Electronic bination lock described in this paper is characterized with high security, low power consumption, and simplicity of operation etc. Keywords: Singlechip microputer, Combination lock, Electronic lock, Matrix keyboard, Power lost storage 西南科技大學(xué)本科生畢業(yè)論文 III 目錄 第 1章 緒論 .................................................................................................................. 1 電子密碼鎖簡(jiǎn)介 ................................................................................................. 1 電子密碼鎖設(shè)計(jì)的背景及意義 ......................................................................... 1 電子密碼鎖 的現(xiàn)狀及 發(fā)展趨勢(shì) ......................................................................... 2 第 2章 總體設(shè)計(jì) .......................................................................................................... 3 設(shè)計(jì)分析 ............................................................................................................. 3 系統(tǒng)結(jié)構(gòu) ............................................................................................................. 4 第 3章 硬件電路設(shè)計(jì) .................................................................................................. 5 單片機(jī)接口分配 ................................................................................................. 5 單片機(jī)最小系統(tǒng)設(shè)計(jì) ......................................................................................... 5 時(shí)鐘電路 ....................................................................................................... 5 復(fù)位電路 ....................................................................................................... 6 最小系統(tǒng) ....................................................................................................... 6 矩陣鍵盤(pán)設(shè)計(jì) ..................................................................................................... 7 LCD 顯示模塊設(shè)計(jì) ............................................................................................. 8 掉電存儲(chǔ)模塊 ................................................................................................... 10 I2C 總線 ....................................................................................................... 10 AT24C02 簡(jiǎn)介 ............................................................................................. 12 開(kāi)鎖機(jī)構(gòu) ........................................................................................................... 13 報(bào)警機(jī)構(gòu) ........................................................................................................... 13 硬件綜合設(shè)計(jì) ................................................................................................... 14 第 4章 軟件設(shè)計(jì) ........................................................................................................ 15 軟件總體設(shè)計(jì) ................................................................................................... 15 鍵盤(pán)掃描子程序 ............................................................................................... 16 顯示模塊子程序 ................................................................................................ 18 掉電存儲(chǔ)子程序 ............................................................................................... 20 寫(xiě)操作方式 ................................................................................................. 21 讀操作方式 ................................................................................................. 22 西南科技大學(xué)本科生畢業(yè)論文 IV 定時(shí)器中斷子程序 ..