1、 I 摘 要 在 PROTEUS 模拟仿真软件上,以 AT89C51 单片机为核心器件,结合按键电 路、LED 数码管显示电路、报警指示电路设计了一款保密性好、编码量多、随机 开锁成功率几乎为零的电子密码。利用单片机灵活的编程设计和丰富的 I/O 端口, 及其控制的准确性通过软件程序来控制整个系统实现电子密码锁的基本功能。系 统能实现密码的输入、清除、显示、密码正确开锁,密码错误报警,系统设定初 始密码。同时也显示了 PROTEUS 软件在硬件设计和软件调试方面的高效性。 关键词:计算机应用,电子密码锁,AT89C51 单片机,PROTEUS 软件,系统仿真 II ABSTRACT Abstr
2、act: By using AT89C51 microcontroller, an advanced electronic password lock circuit is designed. The hardware circuit diagram and some software flowchart are given in this paper. As the software of PROTEUS has the function of simulation, the function of 0-9 number keys, confirmation keys and the del
3、ete keys are realized by a 4 3 array. And the circuit composed of tips is displayed by 8-bit digital tube. When a password is entered, only“-”can be displayed. After the entering of password-digit, press the confirm key, and compare the entered password to the set password. If the password is correc
4、t, then the lock to open. Here a second light-emitting diode LED is used as a reminder; if the password is not correct, then the action of pressing the key is prohibited. At the same time, the alarm function of electronic locks works with the “tick” sound. KEY WORDS: computer application, electronic
5、 password, AT89C51 microcontroller, PROTEUS software, system simulation III 目 录 前言 1 第 1 章 单片机 3 1.1 单片机简介. 3 1.2 单片机的硬件特性. 3 1.3 单片机的特点. 3 1.4 单片机的应用范围. 4 第 2 章 电子密码锁的设计 6 2.1 设计方案的选择. 6 2.1.1 采用数字电路控制. 6 2.1.2 采用以单片机为核心的控制. 6 2.2 本设计所要实现的目标. 7 2.3 电子密码锁的程序设计. 7 第 3 章 主要元器介绍 9 3.1 主控芯片 AT89C51 简介 .
6、 9 3.2 AT89C51 的主要性能 . 9 3.3 AT89C51 引脚功能说明 10 3.4 AT89C51 的振荡器与时钟电路 12 3.5 AT89C51 的复位方式 13 3.5.1 复位原理 13 3.5.2 常用复位电路 14 3.6 AT89C51 的程序执行方式 14 3.7 AT89C51 的省电方式 14 3.8 AT89C51 的芯片擦除 15 3.9 锁存器 74LS245 15 3.10 4 3 矩阵键盘 .16 第 4 章 用 PROTEUS 模拟电子密码锁 18 4.1 PROTEUS 简介 18 4.2 PROTEUS 仿真过程 18 IV 4.2.1 启动 PROTEUS ISIS 编辑环境 .18 4.2.2 选取放置仿真元件19 4.2.3 布线 .21 4.2.4 在 PROTEUS ISIS 中进行软件编程 22 4.3 系统调试 .35 4.3.1 将目标代码添加到电路35 4.3.2 电路调试 .36 第 5 章 调试过程与分析 .39 结 论 .40 谢 辞 .41 参考文献 .42 1 前言 在日常的生活和工作中, 住宅与部