sdram_init.asm

来自「LCD output example code for BF5」· 汇编 代码 · 共 65 行

ASM
65
字号
/*****************************************************************************
**																			**
**	 Project Name: 	LCD Colorbar									**	
**																			**
******************************************************************************

Analog Devices, Inc.  All rights reserved.

File Name:	sdram_init.asm

Hardware:       ADSP-BF537

Special Connections:  None

Purpose:	Initialize SDRAM memory.
	
				
******************************************************************************/


#include "defBF537.h"

.section program;
.global _setup_sdram;


_setup_sdram:
	
	/* Check whether SDRAM is enabled already.  If so, jump to done.
	   If not, continue with configurations.  */
	
	P0.L = lo(EBIU_SDSTAT);
	P0.H = hi(EBIU_SDSTAT);
	R2.L = W[P0];								
	CC = BITTST(R2,3);
	IF !CC JUMP done;

	/* Initalize SDRAM registers. */

	//SDRAM Refresh Rate Control Register
	P0.L = lo(EBIU_SDRRC);
	P0.H = hi(EBIU_SDRRC);
	R0.L = 0x03a2;								
	W[P0] = R0.L;

	//SDRAM Memory Bank Control Register
	P0.L = lo(EBIU_SDBCTL);			
	P0.H = hi(EBIU_SDBCTL);					
	R0.L = 0x0013;								
	W[P0] = R0.L;

	//SDRAM Memory Global Control Register	
	P0.L = lo(EBIU_SDGCTL);
	P0.H = hi(EBIU_SDGCTL);
	R0.L = 0x998d;
	R0.H = 0x0091;
	[P0] = R0;	
	SSYNC;
	
done:	
	RTS;
	
	
_setup_sdram.END:	ssync;

⌨️ 快捷键说明

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