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

📄 initial.asm

📁 5509a FLASH 的读写操作程序,测试过没任何问题
💻 ASM
字号:
	.include "emif_reg.asm"
	.text
	.def initial
initial:
************ initial the state register *********************************	
	;disable the globle interrupt                                       ;
	bit(st1,#11)=#0
	bit(st1,#10)=#1 ;40 computation mode
	xdp=#7280h
	
	;disable all the interrupt enable register.
	xar0=#0
	ar0=#0
	*ar0=#0
	ar0=#45h
	*ar0=#0h														;
	;also, at the system design, we should set all the state register	;
	;for st0,st1,st2,st3												;
*************************************************************************
	
;;;;;;;;;;;;;setup the pll to 144MHz/48MHz/120MHz**************
frequencySet_pll:
	ar3=#1c00h                                                ;*
	*port(#1c00h)=#2310h;#2310h;#2110h;?                                      
	;*ar3=#2290h || writeport() this is equal to last line    ;*
again_pll_sub:                                               ;*
	tc1=bit(*ar3,#0) || readport() ;this mean bit(*port(*ar3),#0)
	if(!tc1) goto again_pll_sub                              ;*
	*port(#7fdh)=#000b   

;;;;;;;;;;;;;;;setup all the ce space to accomodate with my board;;;									;												;

;;;;;;;;;;;;;;;setup all the ce space to accomodate with my board;;;									;												;
	;*port(INIT)=#0000h; this regiseter only used for wrting.
	;repeat(#20);in fact, need only 5 cycles
	;nop_16
	;*port(EGCR)=#0000h;#0000h	;when debug set bit7=0 disable  wpe	;			
	;set the asy-ram
	
	;note!!!!!!!!!!!!!!!!!!!
	*port(#6c00h)=#0a05h;set the system registers.;bake is 281h
	;if the SDRAM work unnormal, pls change 6c00 to 0a05
	;*******************************************************
	
	
	.cpl_off
	bit(st1,#14)=#0
	
	ar0=*port(EGCR)
	bit(ar0,@#5)=#0
	*port(EGCR)=ar0
	
	*port(EMIRST)=#0ffffh
	ar0=*port(EGCR)
	ar0&=0f2ffh
	ar0|=#0200h
	*port(EGCR)=ar0
	repeat(#5)
	nop
	
	;#0226h;#02a6h;#0226h;start the emif clk and 1/2 144MHz, 
					; when debug set the bit7=0, 
	;this is the original setting include pcm3002
	;*port(CE01)=#1109h ;0x151f  for bakeup
	;*port(CE02)=#520fh ;0x5332 for bakeup
	;*port(CE03)=#0000h ;0x0000 for bakeup
	
	;used for lcd setment, 
	*port(CE01)=#151fh
	*port(CE02)=#0f75bh
	*port(CE03)=#0000h 
	
	
	
	
	
	*port(CE11)=#151fh
	*port(CE12)=#5fffh
	*port(CE13)=#0000h
	
	;sedt the sdram
	*port(CE21)=#3000h
	*port(CE23)=#0000h
	*port(CE31)=#3000h
	*port(CE33)=#0000h
	;*port(SDC1)=#2911h;#2811h
	*port(SDC1)=#2111h;#2811h
	*port(SDPER)=#03e8h;#0334h;#0578h;#0434h	
	*port(SDC2)=#0222h;#0135h;#0535h;#0135h
	;*port(SDC3)=#07h;#03h
	*port(EGCR)=#0228h
	;ar0=*port(EGCR)
	repeat(#20)
	nop_16
	
	*port(INIT)=#0000h; this regiseter only used for wrting.
	repeat(#20);in fact, need only 5 cycles
	nop_16	  
***************************************************************
	return
	.end
	
	

⌨️ 快捷键说明

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