DAC0832电路与程序(正弦波)_第1页
DAC0832电路与程序(正弦波)_第2页
DAC0832电路与程序(正弦波)_第3页
DAC0832电路与程序(正弦波)_第4页
DAC0832电路与程序(正弦波)_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、精选优质文档-倾情为你奉上精选优质文档-倾情为你奉上专心-专注-专业专心-专注-专业精选优质文档-倾情为你奉上专心-专注-专业DAC0832电路与程序设计(正弦波)1.函数法正弦波#include #include sbit cs1=P23;sbit rd=P24;unsigned char p,q;float f;int a;#define pi 3.void delay(unsigned char i)unsigned char j;for(;i0;i-)for(j=0;j110;j+);void main()cs1=0;rd=0;while(1) q=0; for(q=0;q255)p=

2、0; f=(sin(2*pi/225*q)+1)*128;a=f;P1=a; /delay(10); 2.查表法正弦波高低频叠加#include #include sbit cs1=P23;sbit rd=P24;unsigned char p,m;unsigned char code sin= 0 x80,0 x83,0 x86,0 x89,0 x8D,0 x90,0 x93,0 x96,0 x99,0 x9C,0 x9F,0 xA2,0 xA5,0 xA8,0 xAB,0 xAE,0 xB1,0 xB4,0 xB7,0 xBA,0 xBC,0 xBF,0 xC2,0 xC5,0 xC7,0

3、 xCA,0 xCC,0 xCF,0 xD1,0 xD4,0 xD6,0 xD8,0 xDA,0 xDD,0 xDF,0 xE1,0 xE3,0 xE5,0 xE7,0 xE9,0 xEA,0 xEC,0 xEE,0 xEF,0 xF1,0 xF2,0 xF4,0 xF5,0 xF6,0 xF7,0 xF8,0 xF9,0 xFA,0 xFB,0 xFC,0 xFD,0 xFD,0 xFE,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFF,0 xFE,0 xFD,0 xFD,0 xFC,0 xFB,0

4、 xFA,0 xF9,0 xF8,0 xF7,0 xF6,0 xF5,0 xF4,0 xF2,0 xF1,0 xEF,0 xEE,0 xEC,0 xEA,0 xE9,0 xE7,0 xE5,0 xE3,0 xE1,0 xDF,0 xDD,0 xDA,0 xD8,0 xD6,0 xD4,0 xD1,0 xCF,0 xCC,0 xCA,0 xC7,0 xC5,0 xC2,0 xBF,0 xBC,0 xBA,0 xB7,0 xB4,0 xB1,0 xAE,0 xAB,0 xA8,0 xA5,0 xA2,0 x9F,0 x9C,0 x99,0 x96,0 x93,0 x90,0 x8D,0 x89,0

5、 x86,0 x83,0 x80,0 x80,0 x7C,0 x79,0 x76,0 x72,0 x6F,0 x6C,0 x69,0 x66,0 x63,0 x60,0 x5D,0 x5A,0 x57,0 x55,0 x51,0 x4E,0 x4C,0 x48,0 x45,0 x43,0 x40,0 x3D,0 x3A,0 x38,0 x35,0 x33,0 x30,0 x2E,0 x2B,0 x29,0 x27,0 x25,0 x22,0 x20,0 x1E,0 x1C,0 x1A,0 x18,0 x16,0 x15,0 x13,0 x11,0 x10,0 x0E,0 x0D,0 x0B,0

6、 x0A,0 x09,0 x08,0 x07,0 x06,0 x05,0 x04,0 x03,0 x02,0 x02,0 x01,0 x00,0 x00,0 x00,0 x00,0 x00,0 x00,0 x00,0 x00,0 x00,0 x00,0 x00,0 x00,0 x01,0 x02,0 x02,0 x03,0 x04,0 x05,0 x06,0 x07,0 x08,0 x09,0 x0A,0 x0B,0 x0D,0 x0E,0 x10,0 x11,0 x13,0 x15,0 x16,0 x18,0 x1A,0 x1C,0 x1E,0 x20,0 x22,0 x25,0 x27,0 x29,0 x2B,0 x2E,0 x30,0 x33,0 x35,0 x38,0 x3A,0 x3D,0 x40,0 x43,0 x45,0 x48,0 x4C,0 x4E,0 x51,0 x55,0 x57,0 x5A,0 x5D,0 x60,0 x63,0 x66,0 x69,0 x6C,0 x6F,0 x72,0 x76,0 x79,0 x7C,0 x80;void delay(unsig

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论