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.
Memory Region | Device Type Identifier | Hardware Address Bits | Don’t Care | R/W Select | ||||
---|---|---|---|---|---|---|---|---|
Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2(1) | Bit 1 | Bit 0 | |
Write Protection Register | 1 | 0 | 1 | 1 | A2 | A1 | X | R/W |
- The A1 Address Bit is a “Don’t Care” on the AT24CSW08X when accessing the WPR.
11b
respectively. The remaining bits of the
word address byte are “don’t care” bits as shown in Table 8-2.A7 | A6 | A5 | A4 | A3 | A2 | A1 | A0 | |
---|---|---|---|---|---|---|---|---|
Write Protection Register | 1 | 1 | X | X | X | X | X | X |
D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | |
---|---|---|---|---|---|---|---|---|
Read WPR | 0 | 0 | 0 | 0 | WPRE | WPB1 | WPB0 | WPRL |
Write WPR | 0 | 1 | 0 : No Lock | 0 | ||||
1 : Set Lock |
Bit | Name | Type | Description | ||
---|---|---|---|---|---|
3 | WPRE |
Write Protection Register Enable | R/W | 0 | No Software Write Protection is enabled (Factory Default). |
1 | Write protection is set by the state of the WPB[1:0] bits. | ||||
2:1 | WPB1 | Write-Protect Block Bits | R/W | 00 | Upper ¼ of EEPROM is write protected (Factory Default). |
01 | Upper ½ of EEPROM is write protected. | ||||
WPB0 | 10 | Upper ¾ of EEPROM is write protected. | |||
11 | Entire EEPROM is write protected. | ||||
0 | WPRL | Write-Protect Lock Bit | R/OTP | 0 | WPR can be written to; requires D5 = 0 during write (Factory Default). |
1 | WPR 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.