ASX340AT
www.onsemi.com
26
SLAVE TWO-WIRE SERIAL INTERFACE
The two-wire serial interface bus enables read/write
access to control and status registers within the ASX340AT.
This interface is designed to be compatible with the MIPI
Alliance Standard for Camera Serial Interface 2 (CSI-2) 1.0,
which uses the electrical characteristics and transfer
protocols of the two-wire serial interface specification.
The interface protocol uses a master/slave model in which
a master controls one or more slave devices. The sensor acts
as a slave device. The master generates a clock (SCLK) that
is an input to the sensor and used to synchronize transfers.
Data is transferred between the master and the slave on a
bidirectional signal (SDATA). SDATA is pulled up to VDD_IO
off-chip by a pull-up resistor in the range of 1.5 to 4.7 kΩ.
Protocol
Data transfers on the two-wire serial interface bus are
performed by a sequence of low-level protocol elements, as
follows:
•a start or restart condition
•a slave address/data direction byte
•a 16-bit register address
•an acknowledge or a no-acknowledge bit
•data bytes
•a stop condition
The bus is idle when both SCLK and SDATA are HIGH.
Control of the bus is initiated with a start condition, and the
bus is released with a stop condition. Only the master can
generate the start and stop conditions.
The SADDR pin is used to select between two different
addresses in case of conflict with another device. If SADDR
is LOW, the slave address is 0 x 90; if SADDR is HIGH, the
slave address is 0 x BA. See Table 21.
Table 21. TWO-WIRE INTERFACE ID ADDRESS
SWITCHING
SADDR Two-Wire Interface Address ID
0 0x90
1 0xBA
Start Condition
A start condition is defined as a HIGH-to-LOW transition
on SDATA while SCLK is HIGH. At the end of a transfer, the
master can generate a start condition without previously
generating a stop condition; this is known as a “repeated
start” or “restart” condition.
Data Transfer
Data is transferred serially, 8 bits at a time, with the MSB
transmitted first. Each byte of data is followed by an
acknowledge bit or a no-acknowledge bit. This data transfer
mechanism is used for the slave address/data direction byte
and for message bytes.
One data bit is transferred during each SCLK clock period.
SDATA can change when SCLK is low and must be stable
while SCLK is HIGH.
Slave Address/Data Direction Byte
Bits [7:1] of this byte represent the device slave address
and bit [0] indicates the data transfer direction. A “0” in bit
[0] indicates a write, and a “1” indicates a read. The default
slave addresses used by the ASX340AT are 0 x 90 (write
address) and 0 x 91 (read address). Alternate slave addresses
of 0 x BA (write address) and 0 x BB (read address) can be
selected by asserting the SADDR input signal.
Message Byte
Message bytes are used for sending register addresses and
register write data to the slave device and for retrieving
register read data. The protocol used is outside the scope of
the two-wire serial interface specification.
Acknowledge Bit
Each 8-bit data transfer is followed by an acknowledge bit
or a no-acknowledge bit in the SCLK clock period following
the data transfer. The transmitter (which is the master when
writing, or the slave when reading) releases SDATA. The
receiver indicates an acknowledge bit by driving SDATA
LOW. As for data transfers, SDATA can change when SCLK
is LOW and must be stable while SCLK is HIGH.
No-Acknowledge Bit
The no-acknowledge bit is generated when the receiver
does not drive SDATA low during the SCLK clock period
following a data transfer. A no-acknowledge bit is used to
terminate a read sequence.
Stop Condition
A stop condition is defined as a LOW-to-HIGH transition
on SDATA while SCLK is HIGH.
Typical Operation
A typical READ or WRITE sequence begins by the
master generating a start condition on the bus. After the start
condition, the master sends the 8-bit slave address/data
direction byte. The last bit indicates whether the request is
for a READ or a WRITE, where a “0” indicates a WRITE
and a “1” indicates a READ. If the address matches the
address of the slave device, the slave device acknowledges
receipt of the address by generating an acknowledge bit on
the bus.
If the request was a WRITE, the master then transfers the
16-bit register address to which a WRITE will take place.
This transfer takes place as two 8-bit sequences and the slave
sends an acknowledge bit after each sequence to indicate
that the byte has been received. The master will then transfer
the 16-bit data, as two 8-bit sequences and the slave sends an
acknowledge bit after each sequence to indicate that the byte
has been received. The master stops writing by generating