5 global protect/unprotect – Rainbow Electronics AT25DQ321 User Manual

Page 28

Advertising
background image

28

AT25DQ321 [DATASHEET]

8718D–DFLASH–12/2012

9.5

Global Protect/Unprotect

The Global Protect and Global Unprotect features can work in conjunction with the Protect Sector and Unprotect Sector
functions.

Example:

A system can globally protect the entire memory array and then use the Unprotect Sector command to
individually unprotect certain sectors and individually reprotect them later by using the Protect Sector
command. Likewise, a system can globally unprotect the entire memory array and then individually protect
certain sectors as needed.

Performing a Global Protect or Global Unprotect is accomplished by writing a certain combination of data to the Status
Register using the Write Status Register Byte 1 command (see

“Write Status Register Byte 1” on page 43

for command

execution details). The Write Status Register command is also used to modify the SPRL (Sector Protection Registers
Locked) bit to control hardware and software locking.

To perform a Global Protect, the appropriate WP pin and SPRL conditions must be met and the system must write a
Logical 1 to bits 5, 4, 3, and 2 of the first byte of the Status Register. Conversely, to perform a Global Unprotect, the same
WP and SPRL conditions must be met but the system must write a Logical 0 to bits 5, 4, 3, and 2 of the first byte of the
Status Register.

Table 9-2

details the conditions necessary for a Global Protect or Global Unprotect to be performed.

Sectors that have been erase or program suspended must remain in the unprotected state. If a Global Protect operation
is attempted while a sector is erase or program suspended, the protection operation will abort, the protection states of all
sectors in the Flash memory array will not change and WEL bit in the Status Register will be reset back to a Logical 0.

Essentially, if the SPRL bit of the Status Register is in the Logical 0 state (Sector Protection Registers are not locked),
then writing a 00h to the first byte of the Status Register will perform a Global Unprotect without changing the state of the
SPRL bit. Similarly, writing a 7Fh to the first byte of the Status Register will perform a Global Protect and keep the SPRL
bit in the Logical 0 state. The SPRL bit can, of course, be changed to a Logical 1 by writing an FFh if software-locking or
hardware-locking is desired along with the Global Protect.

If the desire is to only change the SPRL bit without performing a Global Protect or Global Unprotect, then the system can
simply write a 0Fh to the first byte of the Status Register to change the SPRL bit from a Logical 1 to a Logical 0 provided
the WP pin is deasserted. Likewise, the system can write an F0h to change the SPRL bit from a Logical 0 to a Logical 1
without affecting the current sector protection status (no changes will be made to the Sector Protection Registers).

When writing to the first byte of the Status Register, bits 5, 4, 3, and 2 will not actually be modified but will be decoded by
the device for the purposes of the Global Protect and Global Unprotect functions. Only bit 7, the SPRL bit, will actually be
modified. Therefore, when reading the first byte of the Status Register, bits 5, 4, 3, and 2 will not reflect the values written
to them but will instead indicate the status of the WP pin and the sector protection status. Please refer to

“Read Status

Register” on page 39

and

Table 11-1 on page 39

for details on the Status Register format and what values can be read

for bits 5, 4, 3, and 2.

Advertising