DS28DG02: 2Kb SPI EEPROM with PIO, RTC, Reset, Battery Monitor, and Watchdog
22 of 34
WRSR Write SPI Status Register
The WRSR instruction is the only way to update the nonvolatile bits (b7:b2) of the SPI Status register. See Figure
12 for a detailed description of the nonvolatile bits and their function. As a precondition for a successful write
access to the Status register, the WEN bit must be 1 and either the WPEN bit must be 0, or both WPEN and the
logic state at the WPZ pin must be 1, as shown in the write protection summary of Table 2. The WEN bit is set
through the WREN instruction, which must be completed before any write instruction. The WRSR timing diagram
for both SPI communication modes is shown in Figure 15. The graphic assumes that only a single byte follows the
instruction code. In case of multiple bytes following the instruction code, the last of these data bytes is used to
update the SPI Status register. If the SPI Status register is not write-protected AND the WEN bit 1, the write cycle
(transfer to EEPROM) begins with the positive edge of CSZ. The duration of the write cycle is t
PROG
, during which
the RDYZ bit of the SPI Status register reads 1. After the write cycle is completed, the WEN bit is cleared. If the
SPI Status register is write-protected OR WEN was not set to 1 before issuing the WRSR instruction, the positive
edge on CSZ does not start a write cycle and the WEN bit is not cleared. The first Read Memory sequence
executed after WRSR always delivers data from addresses 100h and higher, regardless of the address bit in the
instruction code.
Figure 15. Write SPI Status Register Timing
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
CSZ
SCK
SI
SO
High Impedance
Write Status,
Mode (0,0)
0 0 0 0 0 0 0 1 7 6 5 4 3 2 1 0
Instruction Data to SPI Status Register
t
PROG
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
CSZ
SCK
SI
SO
High Impedance
Write Status,
Mode (1,1)
0 0 0 0 0 0 0 1 7 6 5 4 3 2 1 0
Instruction Data to SPI Status Register
t
PROG
RDSR Read SPI Status Register
RDSR is the only instruction that the DS28DG02 accepts and executes at any time, even if an EEPROM write
cycle is in progress. See Figure 12 for a detailed description of the SPI Status register bits. Besides providing
general read access to the SPI Status register, the main use of this instruction is for the master to test the RDYZ
bit, which signals the end of an EEPROM write cycle. Figure 16 shows the RDSR timing diagram for both SPI
communication modes. The RDYZ state reported through the RDSR instruction is updated on the negative edge of
SCK during the transmission of the LS-bit of the status byte (highlighted in Figure 16, the Mode (0,0) 16 clock
cycles graphic). This allows the master to repeatedly read the SPI Status register by generating additional SCK
pulses, without having to resend the instruction code. The RDSR instruction ends with the positive edge on CSZ.
DS28DG02: 2Kb SPI EEPROM with PIO, RTC, Reset, Battery Monitor, and Watchdog
23 of 34
Figure 16. Read SPI Status Register Timing
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
CSZ
SCK
SI
SO
High Impedance
Read Status,
Mode (0,0),
16 Clock Cycles Version
0 0 0 0 0 1 0 1
Instruction
7 6 5 4 3 2 1 0 7
Data from SPI Status Register Next Byte
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
CSZ
SCK
SI
SO
High Impedance
Read Status,
Mode (0,0),
15 Clock Cycles Version
0 0 0 0 0 1 0 1
Instruction
7 6 5 4 3 2 1 0
Data from SPI Status Register
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
CSZ
SCK
SI
SO
Read Status,
Mode (1,1)
High Impedance
0 0 0 0 0 1 0 1
Instruction
7 6 5 4 3 2 1 0
Data from SPI Status Register
DS28DG02: 2Kb SPI EEPROM with PIO, RTC, Reset, Battery Monitor, and Watchdog
24 of 34
RFSH Refresh PIO Registers
The volatile PIO-related registers from address 120h to 125h are preset with their power-on default values stored in
EEPROM when the device powers up. The fastest way for the master to restore the power-on state without power-
cycling the DS28DG02 is through the RFSH instruction. The RFSH timing diagram for both SPI communication
modes is shown in Figure 17. The PIO register restore begins when the last bit of the instruction code is clocked
into the device (highlighted SCK transition) and ends after the power-up wait time (t
POIP
) is over.
Figure 17. Refresh PIO Registers Timing
0 0 0 0 0 1 1 1
0 1 2 3 4 5 6 7
CSZ
SCK
SI
SO
High Impedance
Refresh, Mode (0,0)
0 1 2 3 4 5 6 7
CSZ
SCK
SI
SO
0 0 0 0 0 1 1 1
High Impedance
Refresh, Mode (1,1)
WRITE Write to Memory and PIO
From the perspective of the master, the DS28DG02 is a memory device with memory ranges made of EEPROM,
SRAM and ROM. Depending on the memory type, the behavior of the device upon receiving a write instruction
varies. Table 3 shows the cases that need to be distinguished.
Table 3. Write Access Cases
STARTING ADDRESS DESCRIPTION
000h to 0FFh User memory (can be write-protected through BP1:BP0).
100h to 10Fh EEPROM registers (reserved and power-on default values, no write-protection).
110h to 11Fh Read-only memory.
120h to 135h SRAM, PIO, and NV SRAM (may be write-protected through RPROT).
136h to 1FFh Nonexisting memory.
The four blocks of user memory consist of 16 segments of 16 bytes each. The first segment begins at address
000h and ends at address 00Fh; segment 2 ranges from 010h to 01Fh, etc. Upon receiving a write instruction with
an address targeting the user memory, any data bytes that follow the address are written to a 16-byte buffer,
beginning at an offset that is determined by the 4 least significant bits of the target address. This buffer is initialized
(pre-loaded) with data from the addressed 16-byte EEPROM segment. Incoming data replaces pre-loaded data.
With every byte received, the buffer's write pointer is incremented. This allows updating from 1 to 16 bytes starting
anywhere within the segment. If the write pointer has reached its maximum value of 1111b and additional data is
received, the pointer wraps around (rolls over) and the incoming data is written to the beginning of the EEPROM
write buffer and continuing. If the target memory is not write-protected AND the WEN bit of the SPI Status register

DS28DG02E-3C+

Mfr. #:
Manufacturer:
Maxim Integrated
Description:
EEPROM 2Kb SPI EEPROM w/PIO RTC/Rst/Bat Mtr/Wtdg
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet