am29lv160dt flash 擦除某一sector时怎么全片都擦除了
这是下面的代码,请高手看看有没有写错。
void flash_erase(P_U16 base_addr){
P_U16 Temp;
U32 i=35000000;
/* Issue the Sector Erase command to am29lv160dt */
Temp = (P_U16)((0x0000555<<1)+FLASH_ADDRESS); *Temp = 0xAA;
Temp = (P_U16)((0x00002AA<<1)+FLASH_ADDRESS); *Temp = 0x55;
Temp = (P_U16)((0x0000555<<1)+FLASH_ADDRESS);
*Temp = 0x80;
Temp = (P_U16)((0x0000555<<1)+FLASH_ADDRESS);
*Temp = 0xAA;
Temp = (P_U16)((0x00002AA<<1)+FLASH_ADDRESS);
*Temp = 0x55;
Temp = base_addr;
*Temp = 0x30;
while(i--);//Delay
} |