北邮单片机实验报告(电子密码锁) - 图文

更新时间:2023-11-17 07:11:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

xx班xx号xx单片机设计实验报告

2015年小学期单片机设计实验报告

题目:基于PIC单片机的电子密码锁

班 级: 班内序号: 实验组号: 学生姓名: 指导教师:

xx班xx号xx单片机设计实验报告 期中检查 教师评语 指导教师签字: 年 月 日

2

xx班xx号xx单片机设计实验报告

基于PIC单片机的电子密码锁

——xx班 xx

实验摘要

在日常的生活和工作中, 住宅与部门的安全防范、单位的文件档案、财务报表以及一些个人资料的保存多以加锁的办法来解决。若使用传统的机械式钥匙开锁,人们常需携带多把钥匙, 使用极不方便, 且钥匙丢失后安全性即大打折扣。随着科学技术的不断发展,人们对日常生活中的安全保险器件的要求越来越高。为满足人们对锁的使用要求,增加其安全性,用密码代替钥匙的密码锁应运而生。密码锁具有安全性高、成本低、功耗低、易操作等优点。 在安全技术防范领域,具有防盗报警功能的电子密码锁逐渐代替传统的机械式密码锁,克服了机械式密码锁密码量少、安全性能差的缺点,使密码锁无论在技术上还是在性能上都大大提高一步。随着大规模集成电路技术的发展,特别是单片机的问世,出现了带微处理器的智能密码锁,它除具有电子密码锁的功能外,还引入了智能化管理、专家分析系统等功能,从而使密码锁具有很高的安全性、可靠性,应用日益广泛。 设计本课题时构思的方案是用以PIC16F877为核心的单片机控制方案。

目前使用的电子密码锁大部分是基于单片机技术,以单片机为主要器件,其编码器与解码器的生成为软件方式。

本系统由16F877单片机系统(美国微芯Microchip 公司推出的高性能单片机)、4×4矩阵键盘、LCD1602显示和报警系统等组成,具有设置、修改四位用户密码、输入提示、密码错误报警等功能 。本系统成本低廉,功能实用。

Abstract

Replace the lock on the preservation of the safety precautions in their daily life and work, housing and department, unit files, financial statements, and some personal information to lock approach to solve. If the use of traditional mechanical key in the lock, people often need to carry multiple keys, use very inconvenient, and the loss of key security that is greatly reduced. Along with the science and technology unceasing development, people daily life safety insurance device requirements more and more high. In order to meet the people on the requirements and increase the security of password key password lock shipped. Password lock is safe, low cost and power consumption is low, easy to operate and When the advent of the shortcomings of less type. In the security technology to guard against, with anti-theft alarm function electronic password lock gradually replace the traditional mechanical cipher lock, overcome the mechanical password lock, safety performance is poor, the password lock both in technology and in performance are greatly improved step. With large scale integrated circuit technology development, in particular, is a single chip, the microprocessor intelligent password lock, which is in addition to the electronic password lock function, but also introduced the intelligent management, expert analysis system and other functions, which enable password lock has a high safety and reliability, is applied more and more widely.

3

xx班xx号xx单片机设计实验报告

This design topic conception scheme Is used to PIC16F877 as the core of the microcontroller control program.

At present, most of the electronic password lock is based on SCM technology, with the single chip microcomputer as the main device, the encoder and decoder are generated as the software.

The functions of this system by 16F877 microcontroller system (American microchip microchip company launched high performance microcontroller), 4 * 4 matrix keyboard, LCD1602 display and alarm system, has set up, modify the four user password, input prompt, wrong password alarm etc.. The system into the low, functional and practical.

关键字

单片机——microcontroller 密码锁——Password lock

LCD1602——LCD1602 4*4矩阵键盘——4*4 matrix keyboard

一.实验论证与比较

1.实验总体方案的确定

本系统电子密码锁的设计主要由4部分组成:PIC16F877单片机,4×4 矩阵键盘接口电路,LCD1602液晶显示以及LED提示灯。本实验的核心是编写程序,实验中采用汇编语言,通过软件MPLAB进行程序的烧写,将一块块的子程序进行嵌套最终融合起来成为整个项目的完整程序。为了实现密码的保密性,采用一个4×4的矩阵式键盘来提高密码的保密性。采用LCD1602液晶显示器来作为显示单元,提高了可读性,使用户对密码锁的运行情况一目了然。

2.PIC16F877系列单片机简介

PIC16F87X ( 含873P874P876P877) 是美国微芯(Microchip) 公司推出的高性能单片机,除具有单片机的通用资源外,该系列单片机还采用哈佛总线结构、二级指令流水线取指方式、精简指令集(RISC)和内部具有E2 PROM 数据存储器及FLASH 结构的程序存储器、仅35 条单字节单周期指令、在系统串行编程技术和在线调试技术。 因此采用该系列单片机的产品具有低成本、低功耗、高速度、高可靠性、体积小、性价比高等特点。 其芯片引脚图如图1所示。 另外,它内部的EEPROM 数据存储器不仅具有掉电保护数据的功能,更重要的是它的读写操作均是由单片机内部时序控制,即外部电路无法对其进行访问, 因而具有极高的数据保密性,这使得PIC16F87X在加密性产品如智能IC 卡、密码锁、电子防盗系统等方面有很广泛的应用。

4

xx班xx号xx单片机设计实验报告

二.系统总体设计

本设计主要由单片机、矩阵键盘和液晶显示器等部分组成。其中矩阵键盘用于输入数字密码和进行各种功能的实现。由用户通过连接单片机的矩阵键盘输入密码,后经过单片机对用户输入的密码与自己保存的密码进行对比,从而判断密码是否正确,然后控制引脚的高低电平传到开锁电路或者报警电路控制开锁还是报警,实际使用时只要将单片机的负载换成电子密码锁的电磁铁吸合线圈即可。

1.系统模块总体框图:

电源电路 复位电路 晶振电路 键盘电路 单 片 机 16F877 LED报警电路 LCD显示电路 5

本文来源:https://www.bwwdw.com/article/cpfv.html

Top