Datasheet

24
Atmel MSL2010 [DATASHEET]
42072A–AVR–05/2013
Figure 15-7. I
2
C Writing a Register Pointer
When no STOP condition is detected, the byte transmitted after the register address byte is a data byte, and is placed
into the register pointed to by the register address byte (Figure 15-8). To simplify writing to multiple consecutive registers,
the register pointer auto-increments during each following acknowledge period. Further data bytes transmitted before a
STOP condition fill subsequent registers.
Figure 15-8. I
2
C Writing Two Data Bytes
15.7 I
2
C Message Format for Reading from the MSL2010
Read the MSL2010 registers using one of two techniques.
The first technique begins the same way as a write, by setting the register address pointer as shown in Figure 15-7,
including the STOP condition (note that even though the final objective is to read data, the R/W bit is first sent as a write
because the address pointer byte is being written into the device). Follow the Figure 15-7 transaction by what shown in
Figure 15-9, with a new START condition and the slave address, this time with the R/W bit set to 1 to indicate a read.
Then, after the slave initiated acknowledge bit, clock out as many bytes as desired, separated by master initiated
acknowledges. The pointer auto-increments during each master initiated acknowledge period. End the transmission with
a not-acknowledge followed by a stop condition.
Figure 15-9. I
2
C Reading Register Data with Preset Register Pointer
The second read technique is illustrated in Figure 15-10. Write to the MSL2010 to set the register pointer, send a
repeated START condition after the second acknowledge bit, then send the slave address again with the R/W bit set to 1
to indicate a read. Then clock out the data bytes separated by master initiated acknowledge bits. The register pointer
auto-increments during each master initiated acknowledge period. End the transmission with a not-acknowledge
SDA
0 1 0 00000 A D7 D0 A
ACKNOWLEDGE
FROM MSL2010
START STOP
SLAVE ADDRESS,
WRITE ACCESS
SET REGISTER
POINTER TO X
......
THE REGISTER POINTER NOW POINTS TO X; A SUBSEQUENT READ
ACCESS READS FROM REGISTER ADDRESS X
ACKNOWLEDGE
FROM MSL2010
SDA
0 1 0 00000 A D7 D0 AAD0 A
ACKNOWLEDGE
FROM MSL2010
START STOP
SLAVE ADDRESS,
WRITE ACCESS
SET REGISTER
POINTER TO X
DATA WRITES TO
REGISTER X
D7
......
THE REGISTER POINTER NOW POINTS TO X + 2; A SUBSEQUENT READ
ACCESS BEGINS READING FROM REGISTER ADDRESS X + 2
ACKNOWLEDGE
FROM MSL2010
ACKNOWLEDGE
FROM MSL2010
......
D7 D0
......
DATA WRITES TO
REGISTER X + 1
ACKNOWLEDGE
FROM MSL2010
SDA
0 1 0 00001 A D7 D0 A D0 A
ACKNOWLEDGE
FROM MSL2010
START STOP
SLAVE ADDRESS,
READ ACCESS
READ REGISTER
ADDRESS X
READ REGISTER
ADDRESS X + 1
D7
......
THE REGISTER POINTER NOW POINTS TO X + 2; A SUBSEQUENT
READ ACCESS READS FROM REGISTER ADDRESS X + 2
NOT ACKNOWLEDGE
FROM MASTER
......
ACKNOWLEDGE
FROM MASTER