an example of how to use the routines
Code:lash_Test: gosub Bsy_chk ' just get the status reg value for ref for SDC_Page= 0 to 5 ' routinE to write / read test data back form flaSH chip SDC_Sector = 15 ' set sector Address 0 to 15 for 8mb chip ' SDC_Page = 0 ' set page start address 0 to 255 SDC_byte = 0 ' set byte start address 0 to 255 Data_Length = 255 For SDC_index = 0 to Data_Length SDC_buffer[SDC_index] = SDC_index ' fill the data buffer with 0 - 255 values next SDC_index gosub Flash_Format ' gosub Flash_Sec_Erase ' gosub Flash_Write ' gosub Flash_Byte_Modify ' gosub Flash_Byte_Erase next SDC_Page Flash_Test_RD: gosub Bsy_chk ' just get the status reg value for ref for SDC_Page = 0 to 5 ' use prev values for sector, page address and length to do a read SDC_Sector = 15 ' set sector Address 0 to 15 for 8mb chip ' SDC_Page = 0 ' set page start address 0 to 255 SDC_byte = 0 ' set byte start address 0 to 255 Data_Length = 255 gosub Flash_Read HSEROUT [13,10,"SDC_buffer PAGE ",dec SDC_Page, 13,10] For SDC_index = 0 To Data_Length HSEROUT [",",Dec3 SDC_buffer[SDC_index] ] next SDC_index next SDC_Page return Flash_protect_test: SDC_Sector = 0 gosub Flash_WR_protect gosub Bsy_chk gosub Flash_Read_ID return


 
			 
			 
			 
					
					

 Re: Spi flash chip example - 8mb flash
 Re: Spi flash chip example - 8mb flash
		 
				
				
				
				
			

Bookmarks