readstatus.asm

来自「ADSP与NANDFLASH的连接」· 汇编 代码 · 共 49 行

ASM
49
字号
#include <def21262.h>


.global READ_STATUS;
.global read_status_cmd;

.extern BYTE_PPDMA;
.extern CLE_delay_func;
.extern PP_DMA_READ;
.extern AFTER_RD_WR_delay_func;
.extern read_status_cmd;

.section/dm seg_dmda;
	.var Erase_Status[1] = 0;
	
.section/pm seg_pmco;
//--------------------------------------------------------------------
READ_STATUS:
			bit set FLAGS FLG1;  //Drive CLE "HI" for the command phase
	
			//Give command "0x70"
			i0 = read_status_cmd;
			r7 = i0;	//this is written to IIPP
			r8 = 1;		//external memory byte transfer count
			m0 = 1;		//modifier to select next byte of command
	
			CALL BYTE_PPDMA;
			idle;//wait for PP Interrupt
	
			CALL CLE_delay_func;//call CLE delay
			//De-assert CLE
			bit clr FLAGS FLG1;
		
			//perform read from Flash memory
			i4 = Erase_Status;
			//read data DN, DN+1......DN+527
			r8 = 4;//external memory byte transfer count
			r7 = i4;
			r6 = LSHIFT r8 by -2;//internal packed word count = r8 / 4
			CALL PP_DMA_READ;
			idle;//wait for PP Interrupt
	
			CALL AFTER_RD_WR_delay_func;//Delay after read / write
							 //I/O0 should be 0 for successful erase
							 //I/O0 is "1" for erase error
			RTS;
READ_STATUS.end:						
//--------------------------------------------------------------------

⌨️ 快捷键说明

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