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

📄 dec6713_sbsram.c

📁 ti 6714b sbram code ti 6714b sbram code
💻 C
字号:

/********************************************************************************\
\*  DEC6713_SBSRAM.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												    *\
\* 	Discription: Erase, write and read the whole chip!							*\
\*	Modified: 05.10.2005.          												*\
\********************************************************************************/
/********************************************************************************\
\*		The example writes some data in one space of SBSRAM. Then copy these data to 
	another space of SBSRAM. 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_chip>
//#include <csl_cache.h>
#include <csl_emif.h>
#include <DEC6713.h>
#include <stdio.h>

/********************************************************************************/
Uint32 *Src_StartAdd;
Uint32 TempData;
extern far void vectors();
/********************************************************************************\
\********************************************************************************/
main()
{	
	Uint32 i;
	
	//Uint8 Reg=0;
	Src_StartAdd = (Uint32 *)0xA0000000;  // Must be SBSRAM address.
	
	/* Initialize CSL,must when using CSL. */
	CSL_init();
	
	/* Initialize DEC6713 board. */
	DEC6713_init();

	/* Write SBSRAM flag */
	DEC6713_cpld_rset(DEC6713_CTL_REG,0x10);
				
	IRQ_setVecs(vectors);     /* point to the IRQ vector table	*/
  	IRQ_globalEnable();       /* Globally enable interrupts       */ 
  	IRQ_nmiEnable();          /* Enable NMI interrupt             */ 

	// Write data!
	//SBSRAM 256K*36bits,the max address is 0x40000.
	for(i=0;i<0x40000;i++)
	{
		*(Src_StartAdd+i) = i;
	}
	printf("\nFinish writing Source data.");
	
	Src_StartAdd = (Uint32 *)0xA0000000;
	/* Compare data. */
	for(i=0;i<0x40000;i++)
	{
		TempData = *(Src_StartAdd++);
		if(TempData != i)
		{	
			printf("\nTest failure!!!");
			printf("\nAddress 0x%x is error!",i);
			exit(0);
		}
		else continue;
		 

	}
	printf("\nTesting is success.");

}
/********************************************************************************\
\*	End of SBSRAM_Test.c *\
\********************************************************************************/


⌨️ 快捷键说明

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