24AA256/24LC256/24FC256
DS21203G-page 8 2001 Microchip Technology Inc.
6.0 WRITE OPERATIONS
6.1 Byte Write
Following the start condition from the master, the
control code (four bits), t he c hi p s ele ct (thre e bits ), an d
the R/W bit (wh ich is a logi c lo w) a re clocke d on to the
bus by the master transmitter. This indicates to the
addressed slave receiver that the addre ss high byte will
follow after it has generate d an acknow ledge bit during
the ninth clock cycle. Therefore, the next byte
transmitted by the master is the high-order byte of the
word address and will be written into the address
pointer of the 24XX256. The next byte is the least sig-
nificant address byte. After receiving another acknowl-
edge signal from the 24XX256, the master device will
transmit the dat a word to be writt en in to th e ad dres se d
memory location. The 24XX256 acknowledges again
and the master generates a stop condition. This ini-
tiates the internal write cycle, and, during this time, the
24XX256 will not generate acknowledge signals
(Figure 6-1). If an attempt is made to write to the array
with the WP pin he ld high, the device wil l acknowl edg e
the command but no write cycle will occur, no data will
be written, and the device will immediately accept a
new command. After a byte write command, the inter-
nal address counter will point to the address location
following the one that was just written.
6.2 Page Write
The writ e co ntro l by te, w ord add res s, and th e firs t da ta
byte are transmitted to the 24XX256 in the same way
as in a byte write. But instea d of generatin g a stop con-
dition, the master transmits up to 63 additional bytes,
which are te mp orari ly stored in the on-chip p age buffer
and will be written into memory after the master has
transmitted a stop condi tion. After rec eipt of each wo rd,
the six lower address pointer bits are internally
increm ented by o ne. If the master s hould trans mit more
than 64 byt es prior to generati ng the stop cond ition, the
address counter will roll over and the previously
receive d dat a will be overwri tten. As w ith the byte w rite
operatio n, once the stop con dit ion i s receiv ed, a n int er-
nal write cycle will begin (Figure 6-2). If an attempt is
made to write to the array with the WP pin held high, the
device will acknowledge the command but no write
cycle will occur, no data will be written, and the device
will immediately accept a new command.
6.3 Write Protection
The W P pin a llows th e user t o writ e-prote ct the entire
array (00 00-7FFF) when the pin i s tied to VCC. I f tied to
VSS or left floating, the write protection is disabled. The
WP pin is sampled at the STOP bit for every write
command (Figure 1-1) Toggling the WP pin after the
STOP bit will have no effect on the execution of the
write cycle.
FIGURE 6-1: BYTE WRITE
FIGURE 6-2: PAGE WRITE
Note: Page write operations are limited to
writing bytes within a single physical
page, regardless of the number of
bytes actually being written. Physical
page boundaries start at addresses
that are integer multiples of the page
buffer size (or ‘page size’) and end at
addresses that are integer multiples of
[page size - 1]. If a page write com-
mand atte mp ts to wr ite a cro ss a phy si -
cal page boundary , the result is that the
data wraps around to the beginning of
the current page (overwriting data pre-
viously stored there), instead of being
written to the next page as might be
expected. It is therefore necessary for
the application software to prevent
page write operations that would
attempt to cross a page boundary.
X
BUS ACT IV IT Y
MASTER
SDA LINE
BUS ACT IV IT Y
S
T
A
R
T
CONTROL
BYTE ADDRESS
HIGH BYTE ADDRESS
LOW BYTE DATA
S
T
O
P
A
C
K
A
C
K
A
C
K
A
C
K
X = don’t care bit
S1010 0
A
2A
1A
0P
X
BUS ACTIVITY
MASTER
SDA LINE
BUS ACTIVITY
S
T
A
R
T
CONTROL
BYTE ADDRESS
HIGH BYTE ADDRESS
LOW BYTE DATA BYTE 0
S
T
O
P
A
C
K
A
C
K
A
C
K
A
C
K
DATA BYTE 63
A
C
K
X = don’t care b i t
S1010 0
A
2A
1A
0P