【资源下载】下载地址如下:
https://docs.qq.com/doc/DTlRSd01BZXNpRUxl
信号发生器是一种常用的信号源,广泛地应用于电子电路、自动控制系统和教学实验等领域。 本设计采用AT89C51单片机作为控制核心,外围采用数字/模拟转换电路(DAC0832)、运放电路(LM324)、按键和LCD液晶显示电路。电路采用单片机和一片DAC0832数模转换器组成数字式低频信号发生器,可产生正弦波、矩形波、锯齿波和三角波四种波形。系统通过单片机产生数字信号,通过DAC0832转换为模拟信号,再通过放大器LM324就可以得到双极性的各种波形,最终由示波器显示出来。通过键盘来控制四种波形的类型选择、频率变化,并通过液晶1602显示其各自的波形类型以及频率数值。
本设计硬件电路简单,软件功能完善,控制系统可靠,性价比较高,具有一定的实用价值和参考价值。
关键词:AT89C51 单片机; 函数信号发生器;DAC0832;LCD液晶显示
0xd6,0xd4,0xd1,0xcf,0xcc,0xca,0xc7,0xc5,0xc2,0xbf,0xbc,0xba,0xb7,0xb4,0xb1,0xae,0xab, 0xa8,0xa5,0xa2,0x9f,0x9c,0x99,0x96,0x93,0x90,0x8d,0x89,0x86,0x83,0x80, 0x80,0x7c,0x79,0x76,0x72,0x6f,0x6c,0x69,0x66,0x63,0x60,0x5d,0x5a,0x57,0x55, 0x51,0x4e,0x4c,0x48,0x45,0x43,0x40,0x3d,0x3a,0x38,0x35,0x33,0x30,0x2e,0x2b, 0x29,0x27,0x25,0x22,0x20,0x1e,0x1c,0x1a,0x18,0x16,0x15,0x13,0x11,0x10,0x0e, 0x0d,0x0b,0x0a,0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x02,0x01,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02 ,0x02,0x03,0x04, 0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0d,0x0e,0x10,0x11,0x13,0x15,0x16,0x18, 0x1a,0x1c,0x1e,0x20,0x22,0x25,0x27,0x29,0x2b,0x2e,0x30,0x33,0x35,0x38,0x3a, 0x3d,0x40,0x43,0x45,0x48,0x4c,0x4e ,0x51,0x55,0x57,0x5a,0x5d,0x60,0x63,0x66 , 0x69,0x6c,0x6f,0x72,0x76,0x79,0x7c,0x80 }; //正弦波码 //--按键 sbit K1=P2^0; sbit K2=P2^1; sbit K3=P2^2; sbit K4=P2^3; sbit K5=P2^4; uchar WaveChoice=0; uchar ys=30; uchar i,a=0; uchar sqar_num=128; //--延时MS 输入一个确切的值用于键盘输入时消除按键抖动 void DelayMS(uchar ms) { uchar i; while(ms--) for(i=0;i<120;i++); } //--延时y*9us 改变ys的值进而利用该函数达到调频率的目的 void Delay1(uint y) { uint i; for(i=y;i>0;i--); }