STV-366-R01 STMICROELECTRONICS [STMicroelectronics], STV-366-R01 Datasheet - Page 21

no-image

STV-366-R01

Manufacturer Part Number
STV-366-R01
Description
1.8V optical mouse sensor
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
VT5366
6.3.3
6.3.4
No data write followed by same location read
When a location is to be read, but the value of the stored index is not known, a write
message with no data byte must be written first, specifying the index. The read message
then completes the message sequence. To avoid relinquishing the serial to bus to another
master a repeated start condition is asserted between the write and read messages. In this
example, the gain value (index = 36) is read as 15.
Figure 12. No data write followed by same location read
Note that the read message must be terminated with a negative acknowledge (A) from the
master. A positive acknowledge at this point would indicate that a multiple read was required
and the slave would put the first bit of the next byte onto the SDA line. If this was a 0 then the
SDA would be held low and the master would not be able to issue a STOP.
Multiple data read
Figure 13. Multiple data read
This example assumes that a write message has already taken place. Note that the read
message is terminated with a negative acknowledge (A) from the master: it is not
guaranteed that the master will be able to issue a stop condition at any other time during a
read message. This is because if the data sent by the slave is all zeros, the sda line cannot
rise, which is part of the stop condition.
Start
S
S
address
Device
20h
21h
Data (@current index)
No data write
A
Ack from slave
A
36
aa
A
from the master
Sr
21h
Ack
A
A
85
Read data
15
Data (@current index+1)
Serial control bus
A
from the master
from the master
Stop
A
P
P
NAck
NAck
21/30

Related parts for STV-366-R01