基于单片机的数字电压表设计毕业论文
目录
TOC \\O \中文摘要 ·········································· (Ⅰ)
英文摘要 ···································································· (Ⅱ) 1 绪论 ········································································ (1)
1.1课题概述 ········································································· (1)
1.1.2数字电压表的发展历程 ··············································· (1) 1.1.3国内外的发展现状与趋势 ············································ (1) 1.2课题的意义和目的 ····························································· (3) 1.3本文所作的主要工作 ·························································· (3)
2 基于单片机数字电压表的总体设计 ································· (4)
2.1设计指标 ········································································· (4) 2.2系统概述 ········································································· (4)
2.2.1硬件电路图及工作过程简介········································· (4) 2.2.2 软件程序设计简介 ···················································· (6) 2.3 小结 ··············································································· (6)
3 基于单片机数字电压表的硬件设计 ································· (7)
3.1器件的选择 ······································································ (7) 3.2 A/D转换电路 ··································································· (7)
3.2.1 A/D转换芯片的选择 ·················································· (7) 3.2.2 ADC0809转换原理介绍 ··············································· (7) 3.2.3 ADC0809芯片介绍 ····················································· (8) 3.2.4 ADC0809与单片机的接口方法 ····································· (9) 3.3单片机介绍 ····································································· (10)
i
3.3.1 单片机介绍 ···························································· (10) 3.3.2采用AT89C51的原因 ················································· (10) 3.3.3 AT89C51芯片主要性能参数········································ (10) 3.3.4功能介绍 ································································ (10) 3.3.5 芯片管脚介绍及分配 ················································ (11) 3.4显示驱动单元设计 ···························································· (13)
3.4.1 ZLG7289芯片介绍 ···················································· (13) 3.4.2 ZLG7289的主要特征 ················································· (13) 3.4.3 ZLG7289引脚功能说明 ·············································· (14) 3.4.4 ZLG7289与单片机及数码管的连接 ······························ (15) 3.4.5时序图中的各项延迟时间 ··········································· (16) 3.4.6控制指令 ································································ (16) 3.5 SPI接口技术··································································· (17)
3.5.1 SPI总线简介 ·························································· (17) 3.5.2 SPI总线的基本结构 ················································· (17) 3.5.3 数据的传输 ···························································· (18) 3.6电压显示电路 ·································································· (19) 3.7小结 ·············································································· (19)
4 基于单片机数字电压表的软件设计 ································ (20)
4.1软件系统整体设计 ···························································· (20)
4.1.1 C51简介 ································································ (20) 4.1.2 程序流程图 ···························································· (21) 4.1.3数据采集模块的设计 ················································· (23) 4.1.4数据处理模块的设计 ················································· (23)
ii
4.2 C51程序 ········································································ (23) 4.3小结 ·············································································· (23)
5 基于单片机数字电压表的抗干扰设计 ····························· (23)
5.1硬件系统的可靠性与抗干扰设计 ·········································· (23)
5.1.1供电系统抗干扰措施 ················································· (23) 5.1.2接地 ······································································ (23) 5.1.3传输通道的抗干扰措施 ·············································· (24) 5.2软件系统的可靠性与抗干扰设计 ·········································· (24) 5.3小结 ·············································································· (24)
6 电路制作及调试 ························································ (26)
6.1 PCB板的制作 ·································································· (26) 6.2系统外观 ········································································ (27) 6.3电路调试 ········································································ (28)
6.3.1调试步骤 ································································ (28) 6.3.2可能出现的问题解答 ················································· (28) 6.4系统调试及结果分析 ························································· (29) 6.4小结 ·············································································· (29)
7 结论 ······································································· (30)
7.1主要结论 ········································································ (30) 7.2进一步工作及展望 ···························································· (31)
致谢 ·········································································· (32) 参考文献 ···································································· (33) 附录 ????????????????????????(34)
附录A ················································································· (34) 附录B ················································································· (39)
iii
1 绪论
1.1课题概述
1.1.2数字电压表的发展历程
数字电压表简称DVM,它是采用数字化测量技术设计的电压表。从性能来看:数字电压表的发展从一九五二年美国NLS公司由四位电子管数字电压表精度千分之一到现在已经出现8位数字电压表。参数可测量直流电压、交流电压、电流、阻抗等。测量自动化程度不断提高,可以和计算机配合显示、计算结果、然后打印出来。目前世界上美国FLUKE公司,在直流和低频交流电量的校准领域居国际先进水平。例如该公司生产的“4700A”多功能校准器和“8505”危机数字多用电压表,可用8位显示,直流精度可达到±5/10-6,读书分辨力为0.1μV。带有A/D变换模式、数据输出接口形式IEEE-488。具有比率测量软件校准和有交流电阻、电流选件。还具有高精度电压校准器“5400A”、“5200A”、“5450A”等数字仪表,都是作为一级计量站和国家级计量站使用的标准仪表。还有英国的“7055”数字电压表采用脉冲调制技术。日本横河公司的“2501”型采用三次采样等等在不断的蓬勃发展[1]。
从发展过程来看:数字电压表自1952年问世以来,已有50年多年的发展史,大致经历了五代产品。第一代产品是20世纪50年代问世的电子管数字电压表,第二代产品属于20世纪60年代出现的晶体管数字电压表,第三带产品为20世纪70年代研制的中、小规模集成电路的数字电压表。今年来,国内外相继推出有大规模集成电路(LSI)或超大规模集成电路(VLSI)构成的数字电压表、智能数字电压表,分别属于第四代、第五代产品。它们不仅开创了电子测量的先河,更以高准确度、高可靠性、高分辨力、高性价比等优良特性而受到人民的青睐[2]。
1.1.3国内外的发展现状与趋势
数字电压表作为电压表的一个分支,在近五十年间得到巨大发展,构成数字
iv
西安工业大学学士学位论文 电压表的核心器件已从早期的中小规模电路跨入到大规模ASIC(专用集成电路)阶段。数字电压表涉及的范围也从传统的测量扩展至自动控制、传感、通信等领域,展示了广阔的应用前景。
传统电压表的设计思路主要分为:用电流计和电阻构成的电压表;用中小规模集成电路构成的电压表;用大规模ASIC(专用集成电路)构成的电压表。这几中电压表设计方式各有优势和缺点,分别适用于几种特定的应用环境,同时,也为很多新颖的电压表的设计所借鉴和依据[2]。
近入21世纪,随着信息技术一日千里的发展,电压表也必经历从单一测量向数据处理、自动控制等多功能过度的这一历程,特别是计算机技术的发展必将出现智能化技术。因此,把电压表和计算机技术相结合的智能化电压表就将成为21世纪的新课题。目前,数字化仪器与微处理器取得令人瞩目的进展,就其技术背景而言,一个内藏微处理器的仪表意味着计算机技术向仪器仪表的移植,它所具有的软件功能使仪器 呈现出有某种延伸,强化的作用。这相对于过去传统的、纯硬件的仪器来说是一种新的突破,其发展潜力十分巨大,这已为70年代以来仪表发展的历史所证实。概括起来,具有微处理器的仪表具有以下特点:①测量过程的软件控制对测量数据进行存储及运算的数据处理功能是仪表最突出的特点;②在仪器的测量过程中综合了软件控制及数据处理功能,使一机多用或仪器的多功能化易于实现,成为这类仪器的又一特点;③以其软件为主体的智能仪器不仅在使用方便、功能多样化等方面呈现很大的灵活性[3]。
下面从5个方面阐述新型数字仪表的发展趋向。 (1).广泛采用新技术,不断开发新产品
随着科学技术的发展,新技术的广泛应用,新器件的不断出现。首先是A/D转换器:20世纪90年代世界各国相继研发了新的A/D转换技术。例如,四斜率A/D转换技术(美国)、余数再循环技术(美国)、自动校准技术(英国)、固态真有效值转换技术(英国)、约瑟夫森效应基准源(2个纳米稳定度)、智能化专用芯片(80C51系列,荷兰)等,这些新技术使数字电压表向高准确度、高可靠性及智能化、低成本方向发展。另外,集成电路的发展使电压表只在外围配置少量元器件,即可构成完整的智能仪表,可以完成储存、计算、比较、控制等多项功能[4]。
(2).广泛采用新工艺 新一代数字仪表正朝着标准模块化的方向发展。预计在不久的将来,更多的数字仪表将由标准化、通用化、系列化的模块所构成,给电路设计、安装调试和维修带来极大方便。
(3).多从显示仪表
为彻底解决数字仪表不便于观察连续变化量的技术难题;“数字/模拟条图”双显示仪表已成为国际流行款式,它兼有数字仪表准确度高、模拟式仪表便于观察被测量的变化过程及变化趋势这两大优点。
(4).提高安全性
2