Figure 5. data write, slave receiver mode, Figure 6. data read, slave transmitter mode – Rainbow Electronics DS1682 User Manual
Page 10

DS1682
10 of 15
The DS1682 can operate in the following two modes:
1) Slave Receiver Mode (DS1682 Write Mode): Serial data and clock are received through SDA and
SCL. After each byte is received, the receiver transmits an acknowledge bit. START and STOP
conditions are recognized as the beginning and end of a serial transfer. The slave address byte is the
first byte received after the start condition is generated by the master. The address byte contains the 7-
bit DS1682 address, which is 1101011, followed by the direction bit (R/W). The second byte from the
master is the register address. This sets the register pointer. The master then transmits each byte of
data, with the DS1682 acknowledging each byte received. The master will generate a stop condition
to terminate the data write (Figure 5).
Figure 5. DATA WRITE, SLAVE RECEIVER MODE
2) Slave Transmitter Mode (DS1682 Read Mode): The first byte is received and handled as in the
slave receiver mode. However, in this mode, the direction bit indicates that the transfer direction is
reversed. Serial data is transmitted on SDA by the DS1682 while the serial clock is input on SCL. The
slave address byte is the first byte received after the start condition is generated by the master. The
address byte contains the 7-bit DS1682 address, followed by the direction bit (R/W). After receiving a
valid slave address byte and direction bit, the DS1682 generates an acknowledge on the SDA line.
The DS1682 begins to transmit data on each SCL pulse starting with the register address pointed to by
the register pointer. As the master reads each byte, it must generate an acknowledge. The DS1682
must receive a “not acknowledge” on the last byte to end a read (Figure 6).
Figure 6. DATA READ, SLAVE TRANSMITTER MODE
R/W
R/W - Read/Write or Direction Bit
S
1101011
0
A
XXXXXXXX
A
XXXXXXXX
A
XXXXXXXX
A
XXXXXXXX
P
Data Transferred
(X + 1 Bytes + Acknowledge)
SLAVE
ADDRESS
REGISTER
ADDRESS
S - Start
A - Acknowledge
P - Stop
DATA(n)
DATA(n+1)
DATA(n+x)
S
1101011
1
A
XXXXXXXX
A
XXXXXXXX
A
XXXXXXXX
A
XXXXXXXX /A
Data Transferred
(X + 1 Bytes + Acknowledge)
SLAVE
ADDRESS
S - Start
A - Acknowledge
P - Stop
/A - Not Acknowledge
R/W - Read/Write or Direction Bit
DATA(n)
DATA(n+1)
DATA(n+x)
DATA(n+2)
R/W