M24128, M24C64, M24C32 Device operation
15/35
4.6 Write operations
Following a Start condition the bus master sends a device select code with the Read/Write
bit (RW) reset to 0. Th e device ackno wledges this, as sh own in Figure 8, and waits for tw o
address bytes. The device respond s t o each address byte with an acknowledge bit, and
then waits for the data Byte.
Writing to the mem o ry may be inhibited if Write Control (WC) is driven high. Any Write
instruction with Write Control (WC) driven high (during a period of time from the Start
condition until the end of the two address bytes) will not modify the memory contents, and
the accompanying data bytes are not acknowledged, as shown in Figure 7.
Each data byte in the memory has a 16-bit (two byte wide) address. The Most Significant
Byte (Table 4) is sent firs t, followed by the Least Signi fica nt Byte ( Table 5). Bits b15 to b0
form the address of the byte in memory.
When the bus master generates a Stop condition immediately after the Ack bit (in the “10th
bit” time slot) , either at the end of a Byte Write or a Page Write, the internal Write cycle is
triggered. A Stop condition at any other time slot does not trigger the internal Write cycle.
After the Stop condition, the delay tW, and the successful completion of a Write operation,
the device’s internal address counter is incremented automatically, to point to the next byte
address after the last one that was modif ied.
During the internal Write cycle , Serial Data (SD A) is disab led int ernally, and the de vice does
not respond to any requests.
4.7 Byte Write
After the device select code and the address bytes, the bus master sends one data byte. If
the addressed loc at i on is Write-protected, by Write Control (W C ) being driven high, the
de vice replies with NoAck, and the location is not modified. If, instead, the addressed
location is not Write-protected, the device replies with Ack. The bus master terminates the
transfer by generating a Stop condition, as shown in Figure 8.
4.8 Page Write
The Page Write mode allo ws up to 32 bytes (for the M24C32 and M24C64) or 64 bytes (for
the M24128) to be written in a single Write cycle, provide d that they are all located in the
same ’row’ in the memory: that is, the most significant memory address bits (b13-b6 for
M24128, b12- b5 for M24 C64, and b11-b5 for M24C32) a re the same . If more b y tes are sen t
than will fit up to the end of the row, a condition known as ‘roll-over’ occurs. This should be
avoided, as data starts to become overwritten in an implementation dependent way.
The b us master sends from 1 to 32 b y tes of data (for the M24 C32 and M24C64) or 64 b ytes
of data (f or the M2412 8), each of which is ac knowledged b y the de vice if Write Contr ol (WC)
is low. If Write Control (WC) is high, the contents of the addressed memory location are not
modified, and each data byte is followed by a NoAck. After each byte is transferred, the
internal byte address cou nter (inside the page) is incre mented. The transf er is terminated by
the bus master genera ting a Stop condition.