8.1 Software Write Protection of the EEPROM Array

The AT24CSW04X/AT24CSW08X utilizes a software scheme that allows a portion or the entire EEPROM to be inhibited from being written to by modifying the contents of the Write Protection Register (WPR). If desired, the WPR can be set so that it may no longer be modified, thereby making the current protection scheme permanent.

The status of the WPR can be determined by following a random read operation. Changing the state of the WPR is accomplished with a byte write operation with the requirements outlined in this section.

Accessing the WPR requires the use of 1011b (Bh) as the device type identifier in the device address byte (see Table 8-1). Following the device type identifier are the hardware address bits (A2, A1) for which the values are determined by the ordering code of the device (see Table 6-3 and Table 6-4). Finally, bit 0 is the Read/Write Select bit where a logic ‘1’ is used for reading and a logic ‘0’ is used for writing.

Table 8-1. Device Address Byte Requirements for Accessing the Write Protection Register
Memory RegionDevice Type IdentifierHardware Address BitsDon’t CareR/W Select
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2(1)Bit 1Bit 0
Write Protection Register1011A2A1XR/W
Note:
  1. The A1 Address Bit is a “Don’t Care” on the AT24CSW08X when accessing the WPR.
When accessing the Write Protection register, it is required that the A7 and A6 bits of the word address be set to 11b respectively. The remaining bits of the word address byte are “don’t care” bits as shown in Table 8-2.
Table 8-2. Word Address Byte Requirements for Accessing the Write Protection Register
A7A6A5A4A3A2A1A0
Write Protection Register11XXXXXX
Following the word address byte are the contents of the 8‑bit Write Protection register. The register format is shown in Table 8-3 and the WPR bit functions are included in Table 8-4.
Table 8-3. Write Protection Register Format
D7D6D5D4D3D2D1D0
Read WPR0000WPREWPB1WPB0WPRL
Write WPR010: No Lock0
1: Set Lock
Table 8-4. Write-Protect Register Bit Function
BitNameTypeDescription
3WPRE

Write Protection Register Enable

R/W0No Software Write Protection is enabled (Factory Default).
1Write protection is set by the state of the WPB[1:0] bits.
2:1WPB1Write-Protect Block BitsR/W00Upper ¼ of EEPROM is write protected (Factory Default).
01Upper ½ of EEPROM is write protected.
WPB010Upper ¾ of EEPROM is write protected.
11Entire EEPROM is write protected.
0WPRLWrite-Protect Lock BitR/OTP0WPR can be written to; requires D5 = 0 during write (Factory Default).
1WPR will become permanently locked (requires D5 = 1) during write.
  • Write-Protect Register Enable bit (WPRE), Bit 3

    This bit is used to enable or disable the device software write-protect feature. A logic ‘0’ in this position will disable software write protection and a logic ‘1’ will enable this function.

  • Write-Protect Block Bits (WPB[1:0], Bits 2:1)

    These bits allow four levels of protection of the memory array, provided that the WPRE bit is a logic ‘1’. If the WPRE bit is a logic ‘0’, the state of the WPB[1:0] bits have no impact on device protection. The protected address ranges are found in Table 8-5.

  • Write-Protect Lock Bit (WPRL), Bit 0

    This bit is used to permanently lock the current state of the WPR. A logic ‘0’ indicates that the WPR can be modified, whereas a logic ‘1’ indicates the WPR was locked and can no longer be modified. To safeguard against accidental locking of the WPR, the D5 bit must match the WPRL bit (D0 bit) sent to the device. If these bits do not match, the write cycle is aborted and the WPR contents are not modified.