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

📄 dec6713_sdram.c

📁 这是TI的C6713开发板例程
💻 C
字号:
/********************************************************************************\
\*  DEC6713_SDRAM.c	V1.00													    *\

\*  Copyright 2004 by SEED Electronic Technology LTD.                           *\
\*  All rights reserved. SEED Electronic Technology LTD.                        *\
\*  Restricted rights to use, duplicate or disclose this code are               *\
\*  granted through contract.    											    *\
                                             
\*	Designed by: Hongshuai.Li												    *\
\********************************************************************************/
/********************************************************************************\
\*		The example writes some data in one space of SDRAM. Then copy these data to 
	another space of SDRAM. At last read these data into data buffer. You can 
	observe these data in the related address space, and observe message in the
	watch window for running process of the routine.  *\
\********************************************************************************/
#include <csl.h>
#include <csl_irq.h>
#include <csl_cache.h>
#include <csl_emif.h>
#include <DEC6713.h>
#include <stdio.h>
#include <std.h>

/********************************************************************************/
Uint32 *Src_StartAdd;
Uint32 *Dst_StartAdd;
Uint32 *Src_EndAdd;
Uint32 *Dst_EndAdd;
//Uint32 Length;
Uint32 TempData;
Uint32 DataBuff[2048]={0};
Uint32 ReceiveData[2048] = {0};
//extern far void vectors();
/********************************************************************************\
\********************************************************************************/
main()
{	
	Uint32 i;
//	Uint32 Length = 0;
	
	Src_StartAdd = (Uint32 *)0x80000000;
	Dst_StartAdd = (Uint32 *)0x801FF000;
	Src_EndAdd = (Uint32 *)0x80000FFC;
	Dst_EndAdd = (Uint32 *)0x801FFFFC;

	/* Initialize csl. */
	CSL_init();
	
	/* Initialize DSK6713 board. */
	DEC6713_init();
	  	
	//Length = 2048;
	/* Initialize data.*/
	//for(i=0;i<=Length-1;i++)
	//{
	//	DataBuff[i]=0;
	//	ReceiveData[i]=0;
	//}
	/* Write data in the SOURCE address. */
	for(i=0;i<0x400000;i++)
	{
		*(Src_StartAdd++) = i;
	}

	printf("\nFinish writing Source data.");
	
	Src_StartAdd = (Uint32 *)0x80000000;
	/* Copy data from source address to destination address. */
	//for(i=0;i<=Length-1;i++)
	//{
		
	//	*(Dst_StartAdd+i) = *(Src_StartAdd+i);
	//}

	//printf("\nFinish copying data.");
	
	/* Read data from Dst_StartAdd. */
	for(i=0;i<0x400000;i++)
	{
		TempData = *(Src_StartAdd ++);
		if(TempData != i)
		{
			printf("\nTesting is failure");
			exit(0);
		}
		else continue;
	}
	printf("\nTesting is success");
	//printf("\nFinish reading data.");
	
	/* Compare data. */
	//for(i=0;i<=Length-1;i++)
	//{
	//	if(DataBuff[i] != ReceiveData[i])
	//	{
	//		printf("\nOperation is failure.");
	//		exit(0);
	//	}
//	}
//	printf("\nOperation is success.");
	
	
}
/********************************************************************************\
\*	End of DEC6713_SDRAM.c *\
\********************************************************************************/


⌨️ 快捷键说明

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