M24Cxx-W, M24Cxx-R, M24Cxx-F Device operation
15/34
4.6 Write operations
F ollo wing a Start condition the b us master sends a Device Select Code with the Read/Write
bit (RW) reset to 0. Th e device acknowledges this, as shown in Figure 8, and waits for two
address bytes. The device responds to each address byte with an acknowledge bit, and
then waits for the data Byte.
Writing to the mem o ry m ay be inhibited if Write Control (WC) is driven High. Any Write
instruction with Write Control (WC) dr iven High (during a per i o d of time fr om 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 3) is sent firs t, followed by the Least Significant Byte (Table 4). Bits b15 to b0
form the address of the byte in memory.
When the bus master generates a Stop condition immediatel y 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 ne xt byte
address after the last one that was modified.
During the internal Write cycle, Serial Data (SDA) is disabled internally, and the device do es
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 Co ntr ol (W C ) being dr iven 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 allows up to 32 bytes to be written in a single Write cycle, provided
that they are all located in the same ’row’ in the memory: that is, the most significant
memory address bits (b12-b5 for M24C64-x, and b11-b5 for M24C32-x) are the same. If
more bytes are sent than will fit up to the end of the row, a condition kno w n as ‘roll-over’
occurs. This should be avoided, as da ta starts to become overwritten in an implem en ta tio n
dependent way.
The bus master sends from 1 to 32 bytes of data, each of which is acknowledged by the
device if Write Control (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 counter (the 5 least significant
address bits only) is incremented. The tr ansf er is t erminated by th e b us master gener ating a
Stop condition.