Document Number: 002-00833 Rev. *L
Page 34 of 74
S29VS256R
S29VS128R
S29XS256R
S29XS128R
7.7.3
Sector Erase
The sector erase function erases one sector in the memory array (see
). The device does not require the
system to preprogram prior to erase. The Embedded Erase algorithm automatically programs and verifies the entire memory for an
all zero data pattern prior to electrical erase. After a successful sector erase, all locations within the erased sector contain FFFFh.
The system is not required to provide any controls or timings during these operations. Sector Erase requires 2 commands. Each of
the Sector Addresses must match, the lower addresses must be correct, and the sector must be unlocked previously by executing
the Sector Unlock command and must not be locked by the Sector Lock Range command.
When the Embedded Erase algorithm is complete, the bank returns to idle state and addresses are no longer latched. Note that
while the Embedded Erase operation is in progress, the system can read data from the non-erasing banks. The system can
determine the status of the erase operation by reading the Status Register. See
status bits.
Once the sector erase operation has begun, only reading from outside the erase bank, read of Status Register, and the Erase
Suspend command are valid. All other commands are ignored. However, note that a hardware reset immediately terminates the
erase operation. If that occurs, the sector erase command sequence must be reinitiated once the device has returned to idle state,
to ensure data integrity.
See
Program/Erase Operations on page 30
for parameters and timing diagrams.
Software Functions and Sample Code
The following is a C source code example of using the sector erase function. Refer to the
Cypress Low Level Driver User’s Guide
(available on
) for general information on Cypress Flash memory software development guidelines.
/* Example: Sector Erase Command */
*( (UINT16 *)sector_a 0x555 ) = 0x0080; /* write setup command */
*( (UINT16 *)sector_a 0x2AA) = 0x0030; /* write sector erase command */
Table 33. Sector Erase
Cycle
Description
Operation
Byte Address
Word Address
Data
1
Setup Command
Write
Sector A AAAh
Sector A 555h
0080h
2
Sector Erase Command
Write
Sector A 555h
Sector A 2AA
0030h