⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ad.c

📁 2410开发板在ADS下的D/A转换测试程序。 运行步骤: 1 打开DA.mcp工程文件 2 运行 3 使用示波器
💻 C
字号:

#include <stdlib.h>
#include <string.h>

//Shin, On Pil
#include "def.h"
#include "option.h"
#include "2410addr.h"
#include "2410lib.h"
#include "2410slib.h"

#include "2410etc.h"
#include "2410IIC.h"
#include "2410iis.h"
#include "2410int.h"
#include "2410RTC.h"
#include "2410swi.h"
//#include "cpuspeed.h"
//#include "lcdpwr.h"
#include "timer.h"

//Kang, Weon Tark
#include "adc.h"
#include "dma.h"
#include "dma2.h"
#include "eint.h"
#include "extdma.h"
#include "k9s1208.h"
#include "mmu.h"
#include "nwait.h"
#include "sdi.h"
#include "stone.h"
#include "ts_auto.h"
#include "ts_sep.h"
#include "usbfifo.h"

//Shin, Jeong Seuk
#include "IrDA.h"
#include "lcd.h"
#include "lcdlib.h"
#include "glib.h"
#include "palette.h"
#include "spi.h"
#include "uart0.h"
#include "uart1.h"
#include "uart2.h"

//Kong, In Wook
#include "etc.h"
#include "flash.h"
#include "idle.h"
#include "pd6710.h"
#include "pll.h"
#include "power.h"
#include "pwr_c.h"
#include "stop.h"


int t[19][4]={	0x7f,0xff,0x7f,0x00,//波形函数的数据
				0x89,0xfe,0x75,0x01,
				0x94,0xfc,0x6a,0x02,
				0x9f,0xfa,0x5f,0x04,
				0xaa,0xf7,0x54,0x07,
				0xb4,0xf2,0x4a,0x04,
				0xbe,0xed,0x40,0x11,
				0xc8,0xe7,0x36,0x17,
				0xd1,0xe0,0x2d,0x1e,
				0xd9,0xd9,0x25,0x25,
				0xe0,0xd1,0x1e,0x2d,
				0xe7,0xc8,0x17,0x36,
				0xed,0xbe,0x11,0x40,
				0xf2,0xb4,0x0c,0x4a,
				0xf7,0xaa,0x07,0x54,
				0xfa,0x9f,0x04,0x5f,
				0xfc,0x94,0x02,0x6a,
				0xfe,0x89,0x01,0x75,
				0xff,0x7f,0x00,0x7f
				};
void delay(int i)//延时
{
	int k,j;
	for(k=0;k<=i;k++)
	   for(j=0;j<10000;j++);
}
int Test_DA()
{
	int i,j;
	int x=0x00ffffff;
/*******定义DA转换芯片的地址**********/
	volatile int * DAAdr=(volatile int*)(0x28100008);
	while(1)
	{
/*******向DA转换芯片中写入数据*********/
	for(i=0;i<4;i++)
		for(j=0;j<19;j++)
		{ //  Uart_Printf("%x\n",t[j][i]);
//			x=(t[j][i]<<16)|0x0000ffff;
			x=t[j][i];
			*DAAdr=x;
   
		//	Uart_Printf("%x\n",x);
		//	Uart_Printf("bus data =0x%x\n",*DAAdr);
		}
	}	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -