I2C (Inter Inegrated Communication Systems) : (Type Here)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

I2C (INTER INEGRATED COMMUNICATION SYSTEMS)

 I2C stands for Inter-Integrated Circuit Communications.


 I2C is a synchronous protocol that allows a master device to initiate communication. with a slave device.
Data is exchanged between these devices.
 I2C is also bi-directional. This is implemented by an “Acknowledge” system.
 The “Acknowledge” system or “ACK” system allows data to be sent in one direction to one item on the
I2C bus, and then, that item will “ACK” to indicate the data was received.
 I2C is a synchronous protocol that allows a master device to initiate communication with a slave device.
Data is exchanged between these devices
 Since I2C is synchronous, it has a clock pulse along with the data.
 Since I2C has a clock signal, the clock can vary without disrupting the data.
 The data rate will simply change along with the changes in the clock rate.
 I2C is a Master-Slave protocol.
Clock Stretching is a mechanism for slave devices to make the master wait until data is ready or slave
device has to finish some internal operations (like: ADC conversion, Initial internal Write cycle, etc..)
before proceeding further. In Clock Stretching the SCL line is held low by the slave which pauses the
current transfer.

 I2C is a Bi-directional protocol. Data can flow in any direction on the I2C bus, but when it flows is
controlled by the master device.
 I2C is a Serial Interface and uses only the following two signals to serially exchange
data with another device:
SDA - This signal is known as Serial Data. Any data sent from one device to
another goes on this line.
SCL - This is the Serial Clock signal. It is generated by the master device and
controls when data is sent and when it is read. As mentioned earlier, the signal can
be forced low so that no clock can occur. This is done by a device that has become
too busy to accept more data.

[Type here]
o Idle condition: As you can see in above figure, at the initial condition SDA and SCL both High because of both line pulled
High with pull-up resister.
o Start condition: Data transfer is start when SDA line pulled down mean High to Low when SCL line is High.
o Bit Detect: Slave can understand bit reception when it receives single bit ‘1’ or ‘0’ when SCL line is High.
o Data allowed to change: Transition of bit from 1 to 0 or 0 to 1 is only allowed when SCL line is Low as seen in pick.
o ACK Bit: Transmitter must release the SDA line after transmitting 8 bit to allow the Receiver to pull SDA line Low to
acknowledgement the previous 8 bit data reception.
o Stop condition: is only understood when SDA line goes Low to High while SCL line is High.
Note: In I2C Protocol Byte is transmitted MSB to LSB. And in multi-Byte transmission, every 8 bits has a 9th bit that is an acknowledge

 How good is I2C?


o . I2C requires only two line(two wire), but those two wires can support up to 1008 slave devices.
o Unlike SPI, I2C can support a multi-master system, allowing more than one master to communicate with all devices on the bus
(although the master devices can’t talk to each other over the bus and must take turns using the bus lines).
o Data rates of I2C devices can communicate at the rate of 100kHz to 400kHz.
Repeated starts

Sometimes, it is important that a master device be allowed to exchange several messages in one go, without allowing
other master devices on the bus to interfere. For this reason, the repeated start condition has been defined.

To perform a repeated start, SDA is allowed to go high while SCL is low, SCL is allowed to go high, and then SDA is
brought low again while SCL is high. Because there was no stop condition on the bus, the previous communication wasn’t
truly completed and the current master maintains control of the bus.
At this point, the next message can begin transmission. The syntax of this new message is the same as any other message–
an address frame followed by data frames. Any number of repeated starts is allowed, and the master will maintain control
of the bus until it issues a stop condition.

[Type here]
[Type here]
Start Condition
Every communication in I2C Protocol is begin with start condition which we already studied above how start condition
form. This alerts all slave devices that a transmission is about to start.

Address Frame Byte


The address frame byte include device address which is of 7-bit long and Read(1)/Write(0) bit. The address frame byte is
always sent first when any new communication sequence initiate.

ACK/NACK Bit

The 9th bit of the frame is the NACK/ACK bit(here NA or A). This is the case for all frames (data or address). Once the first
8 bits of the frame are sent, the receiving device is given control over SDA. If the receiving device does not pull the SDA
line low before the 9th clock pulse, it can be inferred that the receiving device either did not receive the data or some
error occur.

Data Bytes
After the address frame byte has been sent, data bytes can begin being transmitted. The master will simply continue
generating clock pulses at a regular interval, and the data will be placed on SDA by either the master or the slave,
[Type here]
depending on whether the R/W bit indicated a read or write operation. The number of data byte is arbitrary, and most
slave devices will auto-increment the internal register, meaning that subsequent reads or writes will come from the next
register in line.

Stop condition

Every communication in I2C Protocol is end with stop condition which we already studied above. During normal data
writing operation, the value on SDA should not change when SCL is high, to avoid false stop conditions.

Clock Synchronization:
Two masters can begin transmitting on a free bus at the same time and there must be a
method for deciding which takes control of the bus and complete its transmission. This is
done by clock synchronization and arbitration.

[Type here]

You might also like