J'ai fait quelque chose comme ça
Code:i=0; while (i<=255) { data_256[i]=170; i++; } SPI_WREN(); block_protection_18[0]=0x00; block_protection_18[1]=0x00; block_protection_18[2]=0x00; block_protection_18[3]=0x00; block_protection_18[4]=0x00; block_protection_18[5]=0x00; block_protection_18[6]=0x00; block_protection_18[7]=0x00; block_protection_18[8]=0x00; block_protection_18[9]=0x00; block_protection_18[10]=0x00; block_protection_18[11]=0x00; block_protection_18[12]=0x00; block_protection_18[13]=0x00; block_protection_18[14]=0x00; block_protection_18[15]=0x00; block_protection_18[16]=0x00; block_protection_18[17]=0x00; SPI_WriteBlockProtection(); SPI_Wait_Busy(); SPI_ReadBlockProtection(); SPI_Wait_Busy(); SPI_WREN(); SPI_Chip_Erase(); //Erase the chip SPI_Wait_Busy(); i=0; SPI_WREN(); while(i<highest_address) { SPI_WREN(); SPI_Page_Program(i); SPI_Wait_Busy(); i=i+256; } SPI_WREN(); j=0; while(j<highest_address) { //SPI_Set_Burst(0x03); //SPI_Read_Burst(j, 64); //verify that it got programmed. //SPI_Wait_Busy(); SPI_HighSpeed_Read_Cont(j, 64); for (i=0;i<64;i++) { if (data_256[i]==170) {tempcheck&=1; } else { tempcheck=0; } } j=j+64; } if ((tempcheck == 1)&&(status==1)) {check=(check+1); status=status&1;} else {status=0;}
Mais pour le moment toujours le même problème de check au dessus de 3FFFF est à 1
-----