摘 要
数字电压表是一种结构简单、应用广泛的测量仪表,近年来越来越多地应用在电压测量场合,因此对其测量精度、可靠性和可维护性的要求也越来越高。数字电压表是也诸多数字化仪表的核心与基础,其数字化是将连续的模拟量如直流电压转换成不连续的离散的数字形式并加以显示,具有清晰直观、读数准确、扩展功能强等特点。
本次毕业设计主要是为了实现可控的两路直流数字电压表。
本次毕业设计对当前数字电压表开发手段进行了比较和分析,最终确定了采用单片机技术实现两路直流数字电压表。本设计采用单片机AT89C51做为主控制器,ADC0832作为A/D转换器,把输入的模拟信号转换成数字信号,单片机对转换的结果进行运算和处理,最后输出驱动液晶显示屏LCD1602显示,并通过+5V电源为此系统供电。这种实现方法的优点是电路简单,性能可靠,实时性好,操作简单,编程容易。
该数字电压表的整个系统具有低成本、易使用和稳定性高等特点。用单片机制作出的直流数字电压表结构简单,可靠性高,价格低廉,在相关领域有着不可忽视的市场前景。
关键词:数字电压表;单片机系统;AT89C51;ADC0832;LCD1602
Abstract
Digital voltmeter is a kind of simple structure, widely used in measuring instrument, in recent years more and more application in voltage measurement of occasions, so the measurement accuracy, reliability and maintainability demands more and more is also high. Digital voltmeter is also the core of many digital instrument with foundation, its digital is a analog quantities such as dc voltage converted into digital form of discrete discontinuous and it shows, with clear intuitive, readings accurate and function expansion strong characteristics.
The graduation design is mainly in order to achieve the controllable two road dc digital voltmeter.
The graduation design on the current digital voltmeter development methods were compared and analyzed, finally determined the one-chip computer technology to achieve two road dc digital voltmeter. This design USES the single-chip microcomputer AT89C51 do ADC0832 mainly controller, A/D converter, as the input analog signal converted into digital signals, the monolithic integrated circuit to convert results are operation and processing, finally outputs drive LCD screen, and through LCD1602 display system current supply power + 5V for. The advantages of this method is simple, reliable performance, circuit good real-time performance, simple operation, programming easier.
The digital voltmeter whole system has low cost, easy to use and stability higher characteristic. With single-chip computer produce dc digital voltmeter simple structure, high reliability, low prices in related fields have overlooked the market prospect.
Key Words: digital voltmeter; Microcomputer System;AT89C51; ADC0832;LCD1602
目 录
摘 要 1
Abstract 2
1 引言 4
2 基于单片机的数字直流电压表设计 6
2.1 主要芯片选择 6
2.1.1 AT89C51单片机简介 6
2.1.2 AT89C51单片机的结构特点 7
2.1.3 AT89C51单片机的外部引脚 8
2.2 A/D转换芯片ADC0832 11
2.2.1 ADC0832特点 11
2.2.2 ADC0832 与单片机的接口电路: 12
2.2.3 单片机对ADC0832 的控制原理: 12
2.3 LCD液晶显示器 14
2.3.1液晶显示器LCD1602简介 14
2.3.2 LCD的基本指令 15
2.4 地址锁存器74LS373 17
2.4.1 74LS373简介 17
2.4.2 74LS373在单片机中的应用 18
3数字电压表硬件电路设计 19
3.1 单片机系统 19
3.2 A/D转换芯片与单片机的连接 19
3.3 时钟电路 20
3.4 复位电路 20
用AT89C51的复位电路如图3-4所示。当单片机一上电,立即复位。电容C3和电阻R1实现上电自动复位。复位也是使单片机退出低功耗工作方式而进入正常状态的一种操作。 20
21
图3-4 复位电路 21
3.5 显示电路 21
3.6 输入电路 22
4系统的软件设计 24
4.1 ADC0832选通设计 24
4.2 LCD显示模块部分 24
4.2.1基本操作程序 24
4.2.2 RAM地址映射图 24
表4-1 对应关系 24
4.2.3状态字说明 24
4.2.4数据指针设置 25
4.2.5显示模式设置 25
4.2.6初始化设置 25
4.2.7其他设置 26
4.3 LCD显示设计 26
4.3.1 地址锁存器74LS373的设计 26
4.3.2 LCD显示程序设计 26
5系统调试 27
5.1软件调试 27
5.1.1 Proteus 简介 27
5.1.2 Keil 简介 27
5.1.3 Proteus与Keil连接调试 28
致谢 32
参考文献 33
附录 34
附录1:总体电路图 34
附录2:源程序 35