基于proteus仿真的信号发生器

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

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

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

资源描述

摘要数字信号发生器是在电子设计,自动控制系统和仪表测量校正调试中应用很多的一种信号发生装置和信号源。本文采用AT89C51单片机构成的数字信号发生器,通过波形变换,可以产生方波,三角波,锯齿波等多种波形,波形的周期可通过程序来改变,并可以根据需要选择单极性输出或者双极性输出。具有线路简单,性能优越,结构紧凑等特点。关键词:AT89C51;数字信号发生器;波形变换ABSTRACTDigitalsignalgeneratorintheelectronicdesign、Automaticcontrolsystemandinstrumentationcorrectionindebuggingapplicationalotofsignalgeneratorandsignalsource。ThispaperusestheAT89C51chipmicroprocessordigitalsignalgenerator,Throughwaveformconversion,canproducesquarewave,trianglewave,sawtoothwaveandotherwave,Waveformcyclecanbeprogrammedtochange。Andcanbebasedontheneedtoselecttheoutputunipolarorbipolaroutput,Withsimplelines,superiorperformance,compactstructure.Keywords:AT89C51;Digitalsignalgenerator;Wavetransformation目录绪论······································································································11单片机的概述及信号发生器·····································································21.1单片机的概述·················································································21.2信号发生器的分类···········································································21.3研究内容·······················································································21.4PROTUES软件的介绍········································································22实验设计原理及芯片简介········································································42.1实验设计原理·················································································42.2AT89C51的简介··············································································42.3DAC0832芯片的简介·······································································62.4DAC0832的工作方式·······································································83实验硬件实现及单元电路的设计······························································103.1硬件设计流程框图··········································································103.2信号发生器的外围结构····································································103.3单片机最小系统设计·······································································113.4波形产生模块设计··········································································114实验仿真结果及调试···········································································17结论··································································································20参考文献·······························································································21致谢··································································································22宿州学院2012届本科生毕业设计绪论1绪论电子测量及其他部门对各类信号发生器的广泛需求及电子技术的迅速发展,促使信号发生器种类增多,性能提高。尤其随着70年代微处理器的出现,更促使信号发生器向着自动化、智能化方向发展。现在,许多信号发生器带有微处理器,因而具备了自校、自检、自动故障诊断和自动波形形成和修正等功能,可以和控制计算机及其他测量仪器一起方便的构成自动测试系统。当前信号发生器总的趋势是想着款频率覆盖、低功耗、高频率精度、多功能、自动化和智能化方向发展。信号发生器广泛应用于电子工程,通信工程,自动控制,遥测控制,测量仪器,仪表和计算机等技术领域。波形信号发生器又称为函数信号发生器,作为试验用信号源,是现今各种电子电路实验设计应用中必不可少的仪器设备之一。目前,市场上常见的波形信号发生器多为纯硬件搭接而成,且波形种类有限,多为锯齿、正弦、方波、三角等波形。信号发生器作为一种常见的应用电子仪器设备,传统的可以完全由硬件电路搭接而成,如采用555振荡电路发生正弦波。三角波和方波的电路便是可取的路径之一,不用依靠单片机。但是这种电路存在波形质量差,控制难,可调范围小,电路复杂和体积大的缺点,在科学研究和生产实践中,如工业过程控制,生物医学,地震模拟机械振动等领域常常要用到低频信号源。而由硬件电路构成的低频信号其性能难以令人满意,而且由于低频信号源所需的RC很大,大电阻,大电容在制作上有些困难,参数的精度亦难以保证;体积大,漏电,损耗显著更是其致命的弱点。一旦工作需求功能有增加,则电路复杂程度会大大增加。本文采用AT89C51单片机构成的波形发生器,可产生三角波,方波,锯齿波和正弦波等多种波形,波形周期可用程序改变,并可根据需要选择单极性输出或者双极性输出,具有线路简单,结构紧凑,性能优越等特点。宿州学院2012届本科生毕业设计单片机的概述及信号发生器21单片机的概述及信号发生器1.1单片机的概述随着大规模集成电路技术的发展,中央处理(CPU)、随机存取存储器(RAM)、只读存储器、(I/O)接口、定时器/计数器和串行通信接口,以及其他一些计算机外围电路等均可集成在一块芯片上构成单片微型计算机,简称为单片机。单片机具有体积小,成本低,性能稳定、使用寿命长等特点。其中最明显的优势就是可以嵌入到各种仪器、设备中,这是其他计算机和网络都无法做到的。1.2信号发生器的分类信号发生器应用广泛,种类繁多,性能各异,分类也不尽一致。按照频率范围分类可以为:超低频信号发生器,低频信号发生器、视频信号发生器、高频波形发生器、甚高频波形发生器和超高频信号发生器。按照输出波形分类可以分为:正弦信号发生器和非正弦信号发生器,非正弦信号发生器又包括:脉冲信号发生器,函数信号发生器、扫频信号发生器、数字序列波形发生器、图形信号发生器、噪声信号发生器等。按照信号发生器性能指标可以分为一般信号发生器和标准信号发生器。前者对输出信号的频率、幅度的准确度和稳定度以及波形失真等要求不高的一类信号发生器。后者是指其输出信号的频率、幅度、调制系数等在一定范围内连续可调,并且读数准确、稳定、屏蔽良好的中、高档信号发生器。1.3研究内容本文是做基于51单片机的信号发生器的设计,将采用编程的方法来实现三角波、锯齿波、方波、正弦波的发生。根据设计的要求,对各种波形的频率和幅度进行程序的编写,并将所写程序装入单片机的程序存储器中。在程序运行中,当接收到来自外界的命令,需要输出某种波形时再调用相应的中断服务子程序和波形发生程序,经电路的数/模转换器和运算放大处理后,从信号发生器的输出端口输出。1.4Protues软件的介绍Protues是目前最好的模拟单片机外围器件的工具,它可以仿真51系列、AVR、宿州学院2012届本科生毕业设计单片机的概述及信号发生器3PIC等常用的MCU及其外围电路(如LCD、RAM、ROM、键盘、马达、LED、AD/DA,部分SPI器件,部分IIC器件…)。本文章基于ProtuesPR06.7SP3和KEILuVision3软件。当然软件仿真精度有限,而且不可能所有的器件都找得到相应的仿真模型,用开发板和仿真器当然是最好的选择,可是对于单片机爱好者,或者简单的开发应该是比较好的选择。Protues与其他的单片机仿真软件不同的是,它不仅能仿真单片机CPU的工作情况,也能反正仿真单片机外围电路或没有单片机参与的其它电路的工作情况。因此在仿真和程序调试时,关心的不再是某些语句执行时单片机寄存器和存储器内容的改变,而是从工程的角度直接看程序运行和电路工作的过程和结果。对于这样的仿真实验,从某种意义上讲,是弥补了实验和工程应用脱节的矛盾和现象。宿州学院2012届本科生毕业设计实验设计原理及芯片简介42实验设计原理及芯片简介2.1实验设计原理数字信号可以通过数/模转换器转换成模拟信号,因此可通过产生数字信号再转换成模拟信号的方法来获得所需要的波形。AT89C51单片机本身就是一个完整的微型计算机,具有组成微型计算机的各种部分部件:中央处理器CPU,随机存取存储器RAM、I/O接口电路、定时器/计数器以及串行通讯接口等,只要将89C51再配置键盘及其接口、显示器及其接口、数模转换及波形输出、指示灯及其接口等四部分。即可构成所需的波形信号发生器,其信号发生器构成原理框图如图2.1所示图2.1信号发生器原理框图89C51是整个波形信号发生器的核心部分,通过程序的编写和执行,产生各种各样的信号,并从键盘接收数据,进行各种功能的转换和信号幅度的调节。当数字信号经过接口电路到达转换电路,将其转换成模拟信号也就是所需要的输出波形。2.2AT89C51的简介图2.2AT89C51芯片外形结构及引脚分布图AT89C51是一种带4K字节闪存可编程可擦除只读存储器(EPEROM-FlashProgrammableandErasableReadOnlyMemory)的低电压、高性能CMOS8位微处理器,俗称单片机[5]。AT89C2051是一种带2K字节内

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

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

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

×
保存成功