基于单片机的数字电压表的设计 下载本文

内容发布更新时间 : 2024/9/23 2:15:54星期一 下面是文章的全部内容请认真阅读。

河南科技学院

2010 届本科毕业设计

设计题目:基于单片机的数字电压表的设计

学生姓名:

所在院系:

所学专业:

导师姓名:

完成时间: 2011-05-25

摘要

本文介绍了一种基于单片机的简易数字电压表的设计。该设计主要由三个模块组成:A/D转换模块,数据处理模块及显示模块。A/D转换主要由芯片ADC0832来完成,它负责把采集到的模拟量转换为相应的数字量在传送到数据处理模块。数据处理则由芯片AT89C51来完成,其负责把ADC0832传送来的数字量经过一定的数据处理,产生相应的显示码送到显示模块进行显示;此外,它还控制着ADC0832芯片工作。

该系统的数字电压表电路简单,所用的元件较少,成本低,且测量精度和可靠性较高。此数字电压表可以测量0-5V的1路模拟直流输入电压值,并通过一

个四位一体的7段数码管显示出来。 关键词 单片机;数字电压表;A/D转换;AT89C51;ADC0832

Design of Simple Digital Voltmeter Based on Single-chip

Microcontroller

Abstract

This paper which introduces a kind of simple digital voltmeter is based on single-chip microcontroller design. The circuit of the voltage meter is mainly consisted of three mould pieces: A/D converting mould piece, A/D converting is mainly completed by the ADC0832, it converts the collected analog data into the digital data and transmits the outcome to the manifestation controlling mould piece. Data processing is mainly completed by the AT89C51 chip, it processes the data produced by the ADC0832 chip and generates the right manifestation codes, also transmits the codes to the manifestation controlling mould piece. Also, the AT89C51 chip controls the ADC0832 chip to work.

The voltmeter features in simple electrical circuit, lower use of elements, low cost, moreover, its measuring precision and reliability. The voltmeter is capable of measuring voltage inputs from 1 route ranging from 0 to 5 volt, and displaying the measurements though a digital code tube of 7 pieces of LED.

Keywords Single-chip microcontroller; Digital voltmeter; A/D converter; AT89C51; ADC0832

目 录

1绪论 ........................................................................ 1 2设计总体方案 ...................................................... 2 设计要求 .......................................................... 2 设计思路 .......................................................... 2 设计方案 .......................................................... 2 3硬件电路设计 ..................................................... 3 单片机最小系统电路 ................................................ 3

ADC0832

介绍 ...................................................... 6 管脚介绍 ............................................... 7

ADC0832 主要特点 ............................................... 7

ADC0832

单片机对ADC0832的控制原理 ............................................. 8

LED

数码管 ....................................................... 10 数码管的主要技术参数 ...................................... 10 数码管的引脚说明 .......................................... 11 数码管编码说明 ..................................................... 12 电路 ..................................................... 14

LED LED LED

单片机最小系统电路 ............................................... 13

AD0832

四位数码管显示电路 ............................................... 14

电路原材料清单 .................................................. 15

使用工具及仪表清单 ........................................................ 16 4软件设计 ......................................................... 17 程序设计总方案 ................................................... 17

系统子程序设计 ................................................. 17 初始化程 .................................................... 17 AD

转换子程序 ................................................ 17

显示子程序 .................................................... 18 5电压表的调试及性能分析...................................... 19 调试与测试 ....................................................... 19

性能分析 .................................................................. 19

6总结 ............................................................. 20 参考文献........................................................... 21 谢辞............................................................... 22 附录............................................................... 23 附录一程序源代码 ................................................. 23 附录二电路图 ............................................................... 27