资源描述:
《课程设计(论文)-基于单片机的波形发生器设计及实现》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、北京联合大学信息学院《电子系统设计与实习》实验报告题目:基于单片机的波形发生器设计及实现专业:电子信息工程班级:电子1201B姓名:学号:13目录1.系统简介12.系统组成框图13.软件流程图14.功能及使用说明15.结果截图16.原理图及源代码程序1131.系统简介这个系统是基于AT89S52单片机的波形信号发生器。使用AT89S52单片机作为控制核心,该系统由数字/模拟转换电路(DAC0832)、按键电路和放大电路等组成。通过按键可控制方波、三角波、正弦波的产生,并可以通过按键来观测占空比。这个设计方法简单、性能良好。2.系统组成框图3.软件流程图6134.功能及使用说
2、明本系统的功能有:通过按键控制,产生方波、正旋波、三角波,观测占空比。5.结果截图1、实物图2、正旋波3、三角波5、方波136.原理图及源代码程序#include#include#defineuintunsignedint#defineucharunsignedcharucharKEY;ucharfrekeycount;ucharfzkeycount;ucharzkbkeycount;ucharF;ucharFSIGN=1;ucharASIGN=1;13ucharZSIGN=1;ucharA;ucharZ;ucharsign;sbit
3、fb=P1^0;sbitsjb=P1^1;sbitzxb=P1^2;sbitpl=P1^3;sbitfz=P1^4;sbitzkb=P3^7;sbitled=P3^6;/*ucharcodesin[100]={128,136,143,151,159,167,174,182,189,196,202,209,215,220,226,231,235,239,243,246,249,251,253,254,255,255,255,254,253,251,249,246,243,239,235,231,226,220,215,209,202,196,189,182,174,167,1
4、59,151,143,136,128,119,112,104,96,88,81,73,66,59,53,46,40,35,29,24,20,16,12,9,6,4,2,1,0,0,0,1,2,4,6,9,12,16,20,24,29,35,40,46,53,59,66,73,81,88,96,104,112,119};*///////////////////*ucharcodesin[50]={128,143,159,174,189,202,215,226,235,243,249,253,255,255,253,249,243,235,226,215,202,189,174
5、,159,143,128,112,96,81,66,53,40,29,20,12,6,2,0,0,2,6,12,20,29,40,53,66,81,96,112};*/////////////////////*ucharcode13sin[25]={128,159,189,215,235,249,255,253,243,226,202,174,143,112,81,53,29,12,2,0,6,20,40,66,96};*/ucharcodesin[250]={0x7F,0x82,0x85,0x89,0x8C,0x8F,0x92,0x95,0x98,0x9C,0x9F,0x
6、A2,0xA5,0xA8,0xAB,0xAE,0xB1,0xB4,0xB7,0xBA,0xBC,0xBF,0xC2,0xC5,0xC7,0xCA,0xCD,0xCF,0xD1,0xD4,0xD6,0xD9,0xDB,0xDD,0xDF,0xE1,0xE3,0xE5,0xE7,0xE9,0xEB,0xEC,0xEE,0xEF,0xF1,0xF2,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFC,0xFD,0xFD,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFD,0x
7、FD,0xFC,0xFC,0xFB,0xFA,0xF9,0xF8,0xF7,0xF6,0xF5,0xF4,0xF2,0xF1,0xEF,0xEE,0xEC,0xEB,0xE9,0xE7,0xE5,0xE3,0xE1,0xDF,0xDD,0xDB,0xD9,0xD6,0xD4,0xD1,0xCF,0xCD,0xCA,0xC7,0xC5,0xC2,0xBF,0xBC,0xBA,0xB7,0xB4,0xB1,0xAE,0xAB,0xA8,0xA5,0xA2,0x9F,0x9C,0x98,0x95,0x92,0x8F,0x