基于AT89C51的电压表设计

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

0课程设计成果说明书题目:基于AT89C51单片机的电压表设计学生姓名:学号:学院:班级:指导教师:2014年12月21日ⅠⅡ浙江海洋学院课程设计任务书2014—2015学年第1学期学院班级专业学生姓名(学号)课程名称单片机课程设计设计题目基于AT89C51单片机的数字电压表完成期限自2014年12月21日至2015年1月5日共2周设计依据1.AT89C51单片机的功能。2.ADC8080模数转换芯片的功能。3.LCD液晶显示原理。设计要求及主要内容1.用AT89C51单片机及ADC0808,设计一种数字电压表。2.查相关资料,完成硬件设计和软件设计。3.画出程序流程图及写出程序清单。4.对开发关键技术、主要芯片加以介绍。5.按要求写硬件实习报告。6.用Proteus实现电路软硬件仿真。7.通过电位器取得0~5V的电压,用ADC0808转换后通过LCD显示。参考资料[1].《单片机原理及及应用》王迎旭编机械工业出版社.[2].《微型计算机原理与接口技术》吴秀清编中国科学技术出版社.[3].《51系列单片机原理及设计实例》楼然苗,李良儿等编北京航空航天大学出版社.指导教师签字日期Ⅲ基于AT89C51单片机的数字电压表设计摘要:随着信息化技术的发展,电子检测经常需要测量高精度的电压。本设计是利用仿真软件Proteus仿真的数字电压表。它基于AT89C51单片机作为主控芯片,用ADC0808A/D转换芯片将电压的模拟量转换为数字量并传给单片机,单片机处理后再由液晶LM016L实现液晶显示,可测量0—5V的电压量,精度为2位小数,误差为0.01V。关键字:数字电压表;AT89C51单片机;Proteus仿真;A/D转换;液晶显示Ⅳ目录前言················································································1第一章系统总体方案选择与说明··············································21.1设计要求·····································································21.2设计思路·····································································21.3设计方案····································································2第二章硬件电路设计····························································32.1AT89C51的功能介绍···························································32.1.1简单概述·······························································32.1.2主要功能特性····························································32.1.3AT89C51的引脚介绍·····················································42.2ADC0808的引脚及功能介绍·····················································42.2.1芯片概述·······························································42.2.2引脚简介································································52.2.3ADC0808的转换原理·····················································52.2.4ADC0808电路接线图······················································52.3显示电路····································································62.3.1LM016L的结构及功能····················································62.3.2LM016L的引脚功能介绍··················································62.3.3LM016L的电路接线图····················································62.4复位电路设计································································72.5振荡电路设计································································72.6提示电路设计·································································82.7总电路·······································································8第三章程序设计与说明·························································93.1主程序框图···································································93.2子程序框图···································································9第四章系统仿真与调试························································10第五章总结······································································11参考文献·············································································11附录一···············································································121前言在电量的测量中,电压、电流和频率是最基本的三个被测量,其中电压量的测量最为经常。而且随着电子技术的发展,更是经常需要测量高精度的电压,所以数字电压表就成为一种必不可少的测量仪器。数字电压表简称DVM,它是采用数字化测量技术,把连续的模拟量转换成不连续、离散的数字形式并加以显示的仪表。由于数字式仪器具有读数准确方便、精度高、误差小、测量速度快等特而得到广泛应用。传统的指针式刻度电压表功能单一,进度低,容易引起视差和视觉疲劳,因而不能满足数字化时代的需要。采用单片机的数字电压表,将连续的模拟量如直流电压转换成不连续的离散的数字形式并加以显示,从而精度高、抗干扰能力强,可扩展性强、集成方便,还可与PC实时通信。数字电压表是诸多数字化仪表的核心与基础。以数字电压表为核心,可以扩展成各种通用数字仪表、专用数字仪表及各种非电量的数字化仪表。目前,由各种单片机和A/D转换器构成的数字电压表作全面深入的了解是很有必要的。最近的几十年来,随着半导体技术、集成电路(IC)和微处理器技术的发展,数字电路和数字化测量技术也有了巨大的进步,从而促使了数字电压表的快速发展,并不断出现新的类型。数字电压表从1952年问世以来,经历了不断改进的过程,从最早采用继电器、电子管和形式发展到了现在的全固态化、集成化(IC化),另一方面,精度也从0.01%-0.005%。目前,数字电压表的内部核心部件是A/D转换器,转换的精度很大程度上影响着数字电压表的准确度,因而,以后数字电压表的发展就着眼在高精度和低成本这两个方面。本文是以简易数字直流电压表的设计为研究内容,本系统主要包括三大模块:转换模块、数据处理模块及显示模块。其中,A/D转换采用ADC0808对输入的模拟信号进行转换,控制核心AT89C51再对转换的结果进行运算处理,最后用液晶LM016L显示数字电压信号。2第一章系统总体方案选择与说明1.1设计要求(1)使用51单片机,AD0808,LCD等元件组成。(2)能测量0-5V的直流电压。(3)能连续、稳定显示所测电压。(4)测量误差0.02V。(5)整数电压提醒。1.2设计思路⑴根据设计要求选择AT89C51单片机为核心控制器件。(2)A/D转换采用ADC0808实现。⑶电压显示采用LCD显示。1.3设计方案数字电压表的设计即将连续的模拟电压信号经过A/D转换器转换成二进制数值再经由单片机软件编程转换成十进制数值并通过显示屏显示。该设计主要由三个模块组成A/D转换模块数据处理模块及显示模块。A/D转换主要由芯片ADC0808来完成它负责把采集到的模拟量转换为相应的数字量在传送到数据处理模块。数据处理则由芯片AT89C51来完成其负责把ADC0808传送来的数字量经过一定的数据处理产生相应的显示码送到显示模块进行显示。此外,它还控制着ADC0808芯片工作。系统框图如图1.1所示。图1.1系统框图P2P3P0时钟电路A/D转换电路测量电压输显示系统指示电路P1AT89C513第二章硬件电路设计2.1AT89C51的功能介绍2.1.1简单概述AT89C51是一种带4K字节闪存可编程可擦除只读存储器FPEROM—FlashProgrammableandErasableReadOnlyMemory的低电压、高性能CMOS8位微处理器俗称单片机。AT89C51是一种带2K字节闪存可编程可擦除只读存储器的单片机。单片机的可擦除只读存储器可以反复擦除1000次。该器件采用ATMEL高密度非易失存储器制造技术制造与工业标准MCS-51指令集和输出管脚相兼容。由于将多功能8位CPU和闪烁存储器组合在单个芯片中ATMEL的AT89C51是一种高效微控制器AT89C2051是它的一种精简版本AT89C51单片机为很多嵌入式控制系统提供了一种灵活性高且价廉的方案。外形及引脚排列如图2.1所示。图2.1AT89C51芯片模型2.1.2主要功能特性(1)4K字节可编程闪烁存储器。(2)32个双向I/O口128×8位内部RAM。(3)2个16位可编程定时/计数器中断时钟频率0-24MHz。(4)可编程串行通道。(5)5个中断源。(6)2个读写中断口线。(7)低功耗的闲置和掉电模式。(8)片内振荡器和时钟电路。42.1.3AT89C51的引脚介绍(1)电源引脚。电源引脚接入单片机的工作电源。VCC(40引脚)电源。GND(20引脚)接地。(2)时钟引脚。XTAL1(19引脚)反相放大器和时钟发生器电路的输入端。XTAL2(20引脚)。(3)复位RST(9引脚)。在振荡器运行时有两个机器周期24个振荡周期以上的高电平出现在此引脚时将使单片机复位只要这个脚保持高电平,51芯片便循环复位。(4)EA/Vpp(31引脚)。EA为外部程序存储器访问允许控制端。当它为高电平时单片机读片内程序存储器在PC值超过0FFFH后将自动转向外部程序存储器。当它为低电平时只限定在外部程序存储器地址为0000H~FFFFH。

1 / 19
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功