编号
淮安信息职业技术学院
毕业论文
题 目 电子密码锁的设计与制作 周凯 16111125 电子工程学院 光电子技术(光伏发电)
161111 徐传顺
二〇一四年六月
学生姓名 学 号 系 部 专 业 班 级 指导教师 顾问教师
摘 要
摘 要
随着科技的发展,单片机已不是一个陌生的名词,它的出现是近代计算机技术发展史上的一个重要里程碑,因为单片机的诞生标志着计算机正式形成了通用计算机系统和嵌入式计算机系统两大分支。单片机单芯片的微小体积和低的成本,可广泛地嵌入到如玩具、家用电器、机器人、仪器仪表、汽车电子系统、工业控制单元、办公自动化设备、金融电子系统、舰船、个人信息终端及通讯产品中,成为现代电子系统中最重要的智能化工具。
本设计以AT89C51单片机为控制核心,结合矩阵键盘、24C02A存储系统等来完成电子密码锁的设计。单片机接收键入的代码后,与存贮在24C02A的密码进行比较,如果密码输入正确,则锁将打开;如果输入不正确则系统报警,但是允许接着输入密码,直到输入正确,系统开锁,设计达到预期效果。
本设计是基于单片机的密码锁设计方案,根据要求,给出了该单片机密码锁的硬件电路和软件程序,同时给出了单片机型号的选择、硬件设计、软件流程图、单片机存储单元的分配、汇编语言源程序及详细注释等内容。
关键词 4×4矩阵键盘 AT89C51 24C02A存储系统 电子密码锁
I
Abstract
Abstract
With the development of science and technology, SCM is not a strange noun, its appearance is an important milepost of modern computer technology
development history, because the microcontroller marks the birth of computer was officially formed the general computer systems and embedded computer system two branches. Single chip microcontroller tiny size and low cost, can be widely embedded in such as toys, household appliances, robotics, instrumentation, automotive electronics, industrial control unit, office automation equipment, electronic financial systems, ship, personal information terminal and communication products, become the most important intelligent tool in modern electronic systems.
This design USES AT89C51 single chip microcomputer as control core, combined with the matrix keyboard, 24 c04a storage system to complete the design of the electronic combination lock, etc. MCU receives the type in the code, after comparing with storage at 24 c04a password, if the password is correct, the lock will open; If the input is not correct the system alarm, but allow and then enter the password, until the input is correct, system lock, designed to achieve the desired effect.
This design is a microcontroller password lock design, based on the requirements, the microcontroller password lock hardware circuit and software program, it also gives the type selection, hardware design, software flow chart, microcontroller storage unit allocation, assembly language source code and detailed notes.
Keywords: 4*4matriix keyboard AT89C51 24c02a storage system electronic combination lock
II
目 录
目 录
摘 要 ............................................................................................................................. I ABSTRACT .................................................................................................................. II 第一章 绪论 ................................................................................................................... 1 1.1背景 ....................................................................................................................... 1 1.2电子锁 ................................................................................................................... 1 1.3电子密码锁的特点 ............................................................................................... 1 1.4电子密码锁的的发展趋势 ................................................................................... 2 第二章 系统总体方案设计 ......................................................................................... 3 2.1系统结构 ............................................................................................................... 3 2.2总体方案比较与论证 ........................................................................................... 3 2.3各方案试验比较 ................................................................................................... 4 第三章 硬件设计 ......................................................................................................... 7 3.1 单片机AT89C51简介 ......................................................................................... 7 3.1.1 主要特性 ........................................................................................................ 7
3.1.2 管脚的说明 .................................................................................................... 8 3.2输入键盘 ............................................................................................................... 9 3.3显示部分 ............................................................................................................. 10 3.3.1 引脚的功能 .................................................................................................. 10 3.3.2 液晶显示指令 .......................................................................................... 10 3.3.3 液晶显示指令 .............................................................................................. 12 3.4震荡电路 ............................................................................................................. 12 3.5外部存储 ............................................................................................................. 12 3.5.1 24c02引脚说明 ............................................................................................ 13 3.5.2 24c02内部寻址,读/写操作 ....................................................................... 13 第四章 系统软件设计 ................................................................................................. 15 4.1主程序模块 ......................................................................................................... 15 4.2键盘扫描及识别子程序 ..................................................................................... 16 4.3系统模块密码设置子程序 ................................................................................. 17 4.4程序调试 ............................................................................................................. 18 第五章 系统仿真设计 ................................................................................................. 21 5.1 PROTEUS软件介绍 .............................................................................................. 21 5.2 PROTEUS 仿真图 ................................................................................................. 22
III