|
我在SST39VF3201上用以下函数进行擦除:
bool SST39VF320X::Erase_One_Block (U32 Dst)
{
bool ReturnStatus=TRUE;
IntOff();
*(U16 *) (BaseAddres + 0x5555 * AddrsShift) = 0x00AA; // 1st write data 0x00AA to device addr 5555H
*(U16 *) (BaseAddres + 0x2AAA * AddrsShift) = 0x0055; // 2nd write data 0x0055 to device addr 2AAAH
*(U16 *) (BaseAddres + 0x5555 * AddrsShift) = 0x0080; // 3rd write data 0x0080 to device addr 5555H
*(U16 *) (BaseAddres + 0x5555 * AddrsShift) = 0x00AA; // 4th write data 0x00AA to device addr 5555H
*(U16 *) (BaseAddres + 0x2AAA * AddrsShift) = 0x0055; // 5th write data 0x0055 to device addr 2AAAH
*(U16 *) (BaseAddres + Dst ) = 0x0050; // 6th write data 0x0050 to device sector addr Dst
ReturnStatus = Check_Toggle_Ready(Dst, BlockEraseTime); // wait TOGGLE bit stops toggling
IntOn();
// ReturnStatus = Check_Data_Polling(Dst, 0xFFFF, BlockEraseTime); // wait until DQ7 outputs 1
return ReturnStatus;
}
擦除之后需要延时20几毫秒,这20几毫秒的时间,只能进行阻塞吗,写flash肯定不行了,但读flash可以吗!
|
|