基于单片机的低频信号发生器设计
2014-08-20任小青王晓娟田芳
任小青+王晓娟+田芳
摘 要: 主要介绍以AT89C51单片机为核心部件的低频信号发生器的设计方法及工作原理。系统采用单片机扩展外部存储器和DAC接口技术,简化了仪器硬件设计。通过波形选择电路读取波形信号经离散化处理之后的波代码, 并通过D/ A 转换,还原成所需要的波形。通过改变存储器输出波代码的速度来调节输出信号的频率,改变放大器的放大倍数来调节输出信号的幅值。此外还讨论了波形离散化处理方法及数据采样点数与存储容量的关系, 并给出了系统结构图和软件框图。
关键词: 低频信号; 数据离散化; 幅值; 典型信号
中图分类号: TN710?34 文献标识码: A 文章编号: 1004?373X(2014)16?0014?04
Design on low?frequency signal generator based on SCM
REN Xiao?qing1, WANG Xiao?juan1, TAN Fang2
(1. School of Mechanical Engineering, Qinghai University, Xining 810016, China;
2. Modern Education Technology Center, Qinghai University, Xining 810016, China)
Abstract: The design approach and working principle of a low?frequency signal generator based on AT89C51 are introduced. The hardware design was simplified by using external memory extended with SCM and DAC interface technology. The wave code after discretization processing of waveform signal is read out though a waveform selection circuit, and reverted to the needed waveform by the D/A converter. The output signal frequency is adjusted by changing the wave code output speed of the memory. The amplitude is adjusted by changing the magnification of the amplifier. The waveform discretization processing method, and the relation between data sampling number and storage capacity are discussed. The system structure chart and software flow chart are given.
Keywords: low?frequency signal; data discretization; amplitude; typical signal
0 引 言
在工业测量控制系统的开发过程中, 常需要采用信号发生器为控制系统提供输入信号来模拟实际输入,并根据输出的频率响应特性来对系统进行调校。该系统不但能提供多种波形信号,而且信号的频率和幅值的大小也很容易控制。用它来模拟多种工况下的真实输入信号, 以达到降低开发成本、提高项目开发效率的目的。本文介绍了以AT89C51单片机为控制核心的低频信号发生器的硬件组成和工作原理。这里利用单片机的强大控制和计算能力,结合DAC接口技术产生频率和幅度都可调的正弦、方波、三角波等典型的波形信号来模拟不同的工况[1]。
1 低频信号发生器的工作过程及硬件组成
该系统的工作过程是通过波形选择电路使AT89C51读入预置的波代码表,根据矩阵键盘电路输入的频率值结合系统时钟与复位电路中的晶振频率,计算出相应的控制码,用来控制将数据输送到D/A转换器的速度,最终实现控制输出信号频率的目的。……
