beautypg.com

10 read-modify-write – Rainbow Electronics AT45DB021E User Manual

Page 15

background image

15

AT45DB021E [PRELIMINARY DATASHEET]

8789B–DFLASH–11/2012

6.10 Read-Modify-Write

A completely self-contained read-modify-write operation can be performed to reprogram any number of sequential bytes
in a page in the main memory array without affecting the rest of the bytes in the same page. This command allows the
device to easily emulate an EEPROM by providing a method to modify a single byte or more in the main memory in a
single operation, without the need for pre-erasing the memory or the need for any external RAM buffers. The
Read-Modify-Write command is essentially a combination of the Main Memory Page to Buffer Transfer, Buffer Write, and
Buffer to Main Memory Page Program with Built-in Erase commands.

To perform a Read-Modify-Write using the standard DataFlash page size (264 bytes), an opcode of 58h for Buffer 1 or
59h for Buffer 2 must be clocked into the device followed by three address bytes comprised of four dummy bits, 11 page
address bits (PA10 - PA0) that specify the page in the main memory to be written, and nine byte address bits (BA8 - BA0)
that designate the starting byte address within the page to reprogram.

To perform a Read-Modify-Write using the binary page size (256 bytes), an opcode of 58h for Buffer 1 or 59h for Buffer 2
must be clocked into the device followed by three address bytes comprised of three dummy bits, 11 page address bits
(A18 - A8) that specify the page in the main memory to be written, and eight byte address bits (A7 - A0) designate the
starting byte address within the page to reprogram.

After the address bytes have been clocked in, any number of sequential data bytes from one to 256/264 bytes can be
clocked into the device. If the end of the buffer is reached when clocking in the data, then the device will wrap around
back to the beginning of the buffer. After all data bytes have been clocked into the device, a low-to-high transition on the
CS pin will start the self-contained, internal read-modify-write operation. Only the data bytes that were clocked into the
device will be reprogrammed in the main memory.

Example:

If only one data byte was clocked into the device, then only one byte in main memory will be reprogrammed
and the remaining bytes in the main memory page will remain in their previous state.

The CS pin must be deasserted on a byte boundary (multiples of eight bits); otherwise, the operation will be aborted and
no data will be programmed. The reprogramming of the data bytes is internally self-timed and should take place in a
maximum time of t

P

. During this time, the RDY/BUSY bit in the Status Register will indicate that the device is busy.

The device also incorporates an intelligent erase and programming algorithm that can detect when a byte location fails to
erase or program properly. If an erase or program error arises, it will be indicated by the EPE bit in the Status Register.

Note:

The Read-Modify-Write command uses the same opcodes as the Auto Page Rewrite command. If no data bytes
are clocked into the device, then the device will perform an Auto Page Rewrite operation. See the Auto Page
Rewrite command description on

page 25

for more details.