题 目 多功能信号发生器的设计与实现 学生姓名 王振华 学号 1213014069 所在学院 物理与电信工程学院 专业班级 电子信息工程 指导教师 梁芳 完成地点 物理与电信工程学院实验室
2016 年 6 月 2 日
多功能信号发生器的设计与实现
王振华
(陕西理工学院 物理与电信工程学院 电子信息工程专业,2012级3班,陕西 汉中 723000)
指导教师:梁芳
[摘要]本文介绍的是利用STC12C5A60S2单片机和数模转换器件DAC0832产生所需不同信号的低频信号源,其信
号幅度和频率都是可以按要求控制的。文中简要介绍了DAC0832数模转换器的结构原理和使用方法,STC12C5A60S2的基础理论,以及与设计电路有关的各种芯片。着重介绍了如何利用单片机控制D/A转换器产生上述信号的硬件电路和软件编程。信号频率幅度也按要求可调。本设计核心任务是:以STC12C5A60S2为核心,结合D/A转换器和DAC0832等器件,用仿真软件设计硬件电路,用C语言编写驱动程序,以实现程序控制产生正弦波、三角波、方波、三种常用低频信号。可以通过键盘选择波形和输入任意频率值。
[关键词]单片机; LCD1602;信号发生器;DAC0832
Design and implementation of multi function signal
generator
Author:Zhenhua Wang
(Grade 12,Class 03,Major in Electronics & Information engineering ,Physics & Telecommunications
engineering Dept., Shaanxi University of Technology,Hanzhong 723000,Shaanxi)
Tutor: Fang Liang
Abstract: This article describes the STC12C5A60S2 microcontroller and digital to analog converter DAC0832 to
produce the desired signal of the low frequency signal source, the signal amplitude and frequency can be controlled as required. The article briefly describes the structure of principles and use of the DAC0832 digital-to-analog converter, the STC12C5A60S2 basic theory and design of circuits a variety of chips. The paper focuses on how to use microcontroller to control the D / A converter to produce the hardware and software programming of the above signals. The signal frequency range is also adjustable as required.The core of the design tasks are: STC12C5A60S2 as the D / A converter and DAC0832 devices, circuit simulation software, design hardware drivers written in C, in order to achieve process control to produce sine wave, triangle wave, square wave, three commonly used low-frequency signals. Waveforms and enter any frequency value can be selected via the keyboard.
Key Words:on STC12C5A60S2 function waveform generator DAC0832 square wave, triangle wave, sine
wave,sawtooth wave
目 录
1 引言 .................................................. 0
1.1 目的和意义 ............................................ 0 1.2 研究概况及发展趋势 .................................... 0 1.3 本系统主要功能 ........................................ 1
2. 总体方案论证与设计 .................................... 2
2.1主控模块的选型和论证 .................................. 2 2.2显示模块的选型和论证 .................................. 2 2.3信号产生模块的选型和论证 .............................. 2 2.4程控放大模块的选型和论证 .............................. 3 2.5负压产生模块的选型和论证 .............................. 3 2.6系统整体设计概述 ...................................... 3
3.系统硬件电路设计 ....................................... 4
3.1主控模块 .............................................. 4 3.1.1 STC12C5A60S2单片机主要特性 ...................... 4 3.1.2 STC12C5A60S2单片机的中断系统 .................... 6 3.1.3 单片机最小系统设计 ............................... 7 3.2 LCD液晶显示器简介 .................................... 7 3.2.1 液晶原理介绍 ..................................... 7 3.2.2液晶模块简介 ..................................... 8 3.2.3液晶显示部分与STC12C5A60S2的接口 ................ 8 3.3键盘模块设计 .......................................... 9 3.4信号产生模块设计 ..................................... 10 3.4.1 直接数字合成技术介绍 ............................ 10 3.4.2 DAC0832芯片介绍 ................................ 11 3.4.3 DAC0832波形发生电路设计 ........................ 12 3.5程控放大模块的设计 ................................... 12 3.6 负压转换电路设计 ..................................... 13
4.系统软件设计 ......................................... 14
4.1系统软件总体设计 .................................... 14 4.2程序设计原理 ........................................ 15
5.系统调试 ............................................. 17
5.1硬件调试 ............................................ 17 5.2软件调试 ............................................ 17
结论 ................................................... 18 致谢 ................................................... 20 参考文献 ............................................... 21 附录A .................................................. 22 附录B .................................................. 23 附录C .................................................. 23 附录D .................................................. 40 附录E .................................................. 45 附录F .................................................. 48