
DS1962/DS1963
020698 5/22
WRITING WITH VERIFICATION
To write data to the DS196X, the scratchpad has to be
used as intermediate storage. First the master issues
the Write Scratchpad command to specify the desired
target address, followed by the data to be written to the
scratchpad. Under certain conditions (see Write
Scratchpad command) the master will receive an
inverted CRC16 of the command, address and data at
the end of the write scratchpad command sequence.
Knowing this CRC value, the master can compare it to
the value it has calculated itself to decide if the commu-
nication was successful and proceed to the Copy
Scratchpad command. If the master could not receive
the CRC16, it has to send the Read Scratchpad com-
mand to read back the scratchpad to verify data integ-
rity. As preamble to the scratchpad data, the DS196X
repeats the target address TA1 and TA2 and sends the
contents of the E/S register. If the PF flag is set, data did
not arrive correctly in the scratchpad. The master does
not need to continue reading; it can start a new trial to
write data to the scratchpad. Similarly, a set AA flag indi-
cates that the Write command was not recognized by
the iButton. If everything went correctly, both flags are
cleared and the ending offset indicates the address of
the last byte written to the scratchpad. Now the master
can continue reading and verifying every data byte.
After the master has verified the data, it has to send the
Copy Scratchpad command. This command must be
followed exactly by the data of the three address regis-
ters TA1, TA2 and E/S. The master may obtain the con-
tents of these registers by reading the scratchpad or
derive it from the target address and the amount of data
to be written. As soon as the DS196X has received
these bytes correctly, it will copy the data to the
requested location beginning at the target address.
MEMORY FUNCTION COMMANDS
The “Memory Function Flow Chart” (Figure 7) describes
the protocols necessary for accessing the memory. An
example follows the flowchart. The communication
between master and DS196X takes place either at regu-
lar speed (default, OD = 0) or at Overdrive Speed (OD =
1). If not explicitly set into the Overdrive Mode the
DS196X assumes regular speed.
Write Scratchpad Command [0FH]
After issuing the write scratchpad command, the master
must first provide the 2–byte target address, followed by
the data to be written to the scratchpad. The data will be
written to the scratchpad starting at the byte offset
(T4:T0). The ending offset (E4: E0) will be the byte offset
at which the master stops writing data. Only full data
bytes are accepted. If the last data byte is incomplete its
content will be ignored and the partial byte flag PF will be
set.
When executing the Write Scratchpad command the
CRC generator inside the DS196X (see Figure 12) cal-
culates a CRC over the entire data stream, starting at
the command code and ending at the last data byte sent
by the master. This CRC is generated using the CRC16
polynomial by first clearing the CRC generator and then
shifting in the command code (0FH) of the Write
Scratchpad command, the Target Addresses TA1 and
TA2 as supplied by the master and all the data bytes.
The master may end the Write Scratchpad command at
any time. However, if the ending offset is 11111b, the
master may send 16 read time slots and will receive the
CRC generated by the DS196X.
The memory address range of the DS1962 is 0000H to
007FH and 0000H to 01FFH for the DS1963, respec-
tively. If the bus master sends a target address higher
than this, the internal circuitry of the chip will set the nine
(DS1962) or seven (DS1963) most significant address
bits to zero as they are shifted into the internal address
register. The Read Scratchpad command will reveal the
target address as it will be used by the DS196X. The
master will identify such address modifications by
comparing the target address read back to the target
address transmitted. If the master does not read the
scratchpad, a subsequent copy scratchpad command
will not work since the most significant bits of the target
address the master sends will not match the value the
DS196X expects.
Read Scratchpad Command [AAH]
This command is used to verify scratchpad data and tar-
get address. After issuing the read scratchpad com-
mand, the master begins reading. The first two bytes will
be the target address. The next byte will be the ending
offset/data status byte (E/S) followed by the scratchpad
data beginning at the byte offset (T4: T0). The master
may read data until the end of the scratchpad after
which the data read will be all logic 1’s.
Copy Scratchpad [5AH]
This command is used to copy data from the scratchpad
to memory. After issuing the copy scratchpad com-
mand, the master must provide a 3–byte authorization