I2C (Inter Inegrated Communication Systems) : (Type Here)
I2C (Inter Inegrated Communication Systems) : (Type Here)
I2C (Inter Inegrated Communication Systems) : (Type Here)
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
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.
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]