学号:201114040215HEBEIUNITEDUNIVERSITY单片机课程设计说明书设计题目:简易电子密码锁学生姓名:李红辉专业班级:测控技术及仪器2学院:电气工程学院指导教师:曹晓华2014年06月05日成绩评定表指导教师评语:答辩成绩:(占总成绩60%)说明书成绩:(占总成绩40%)摘要在日常的生活和工作中,住宅与部门的安全防范、单位的文件档案、财务报表以及一些个人资料的保存多以加锁的办法来解决。若使用传统的机械式钥匙开锁,人们常需携带多把钥匙,使用极不方便,且钥匙丢失后安全性即大打折扣。随着科学技术的不断发展,人们对日常生活中的安全保险器件的要求越来越高。为满足人们对锁的使用要求,增加其安全性,用密码代替钥匙的密码锁应运而生。密码锁具有安全性高、成本低、功耗低、易操作等优点。在安全技术防范领域,具有防盗报警功能的电子密码锁逐渐代替传统的机械式密码锁,克服了机械式密码锁密码量少、安全性能差的缺点,使密码锁无论在技术上还是在性能上都大大提高一步。随着大规模集成电路技术的发展,特别是单片机的问世,出现了带微处理器的智能密码锁,它除具有电子密码锁的功能外,还引入了智能化管理、专家分析系统等功能,从而使密码锁具有很高的安全性、可靠性,应用日益广泛。本课程设计介绍了基于单片机电子密码锁的设计,该设计硬件主要由AT89C52最小系统、矩阵电路、1602LCD显示电路、电源电路和报警电路等几部分组成。软件主要由C语言编程。该密码锁由单片机技术,通过矩阵电路设置、修改密码、保护密码,并由LCD显示密码输入,从而实现对密码的设置、保护。关键词:单片机,密码锁,1602,最小系统,矩阵键盘单片机课程设计说明书AbstractIndailylifeandwork,thedepartmentofhousingandsecurity,unitdocuments,financialstatementsandsomepersonalinformationtosavemoreinordertolockthewaystosolve.Ifusethetraditionalmechanicalkeytoopenthelock,peopleoftenneedtocarrymultiplekeys,useveryconvenient,andthekeymissingaftersecurityiscompromised.Withthecontinuousdevelopmentofscienceandtechnology,peopleindailylifethedemandishigherandhighersafetyinsurancedevice.Tomeettherequirementsofpeopleontheuseofthelock,increaseitssafety,usethepasswordinsteadofthekeycombinationlockarisesatthehistoricmoment.Combinationlockwithhighsafety,lowcost,lowpowerconsumption,easyoperation,etc.Inthefieldofsecuritytechnologytoguardagainst,withelectroniccombinationlockanti-theftalarmfunctiongraduallyreplacethetraditionalmechanicalcombinationlock,overcomingthemechanicalcombinationlockpasswordquantityislittle,theshortcomingsofpoorsafetyperformance,makethecombinationlockbothintechnologyandstepinperformanceareimprovedgreatly.Withthedevelopmentoflargescaleintegratedcircuittechnology,especiallythesinglechipmicrocomputer,appearedwiththeintelligentcombinationofthemicroprocessor,itbesideshasthefunctionofelectroniccombinationlock,alsointroducedtheintelligentmanagement,expertanalysissystem,andotherfunctions,sothatthecombinationlockofhighsecurity,reliability,andincreasinglywidelyused.ThecoursedesignofelectroniccombinationlockbasedonMCUisintroduced,thedesignofthehardwareismainlycomposedofAT89C52minimumsystem,matrixcircuit,1602LCDdisplaycircuit,powercircuitandalarmcircuitandsoonseveralparts.SoftwareismainlycomposedofClanguageprogramming.Thecombinationlockbythesinglechipmicrocomputertechnology,throughthematrixcircuitsetting,changepasswords,passwordprotection,andbytheLCDdisplaypasswordinput,soastorealizethepasswordSettings,protection.单片机课程设计说明书Keywords:singlechipmicrocomputer,tricklock,the1602,thesmallestsystem,matrixkeyboard单片机课程设计说明书目录摘要.........................................................................................................................IIIABSTRACT.......................................................................................................................4第1章绪论.................................................................................................................71.1电子密码锁的现状与发展....................................................................................................71.1.1电子密码锁的现状........................................................................................................71.1.2电子密码锁的发展........................................................................................................71.2电子密码锁的特色................................................................................................................7第2章电子密码锁的工作原理及总体设计..............................................................82.1电子密码锁的工作原理........................................................................................................82.2总体结构的设计....................................................................................................................8第3章硬件系统设计.................................................................错误!未定义书签。3.1单片机最小系统和数据输入.................................................................错误!未定义书签。3.1.1单片机最小系统.............................................................................错误!未定义书签。3.1.2矩阵键盘的设计与初始数据的输入..........................................................................113.2数据的输出与显示.............................................................................................................123.3报警电路..............................................................................................................................163.4硬件电路图..........................................................................................................................17第4章仿真与调试.....................................................................................................194.1程序流程...........................................................................................................................194.2仿真结果...........................................................................................................................20总结.........................................................................................................