Hello, readers welcome to the new post. Here we will discuss Introduction to I2C COMMUNICATION PROTOCOL. I2C is a short form of integrated circuits. It is created by the Philips semiconductor to help the transfer of data among the main point or processor to numerous integrated circuits connected on a single boat through the use of two wires. It is also called IIC and helps to make connections among the less-speed ICs with controllers and processors operating for small level distances.
In this post, we will discuss different paramerts of this communication protocol and learn its different features. So let’s get started.
Introduction to I2C COMMUNICATION PROTOCOL
- I2c has features offered by the SPI and UART. It comes with a similar feature of SPI that connects numerous salve devices to one master or control device.
- It is helpful to display the data of many controllers on a single display.
- Like the SPI and UART, it uses two wires for communications
- SDA helps the master and slave to send and get data
- SCL wire is used for carrying the signal.
- Serial communication is done through I2c so data transfer occurs in one bit after another bit.
- It is synchronous and the clock signal is regulated by the master device.
I2C Features
- Some main features of I2C are discussed here
- There are two wires used to make connections between the control and output devices.
- It has different speed modes of data transfer such as standard mode is 100kbps, fast mode 400kbps
- It is a synchronous and serial protocol for communication
- 1008 slave and unlimited master can be linked to this protocol
Two-Wire Interface:
- It is two-wire interfacing and comes with a serial data line and serial clock SCL. That less complex design minimizes connection for devices, makes design simple, and reduces signal interference.
Multi-Master, Multi-Slave :
- I2C protocol supports master-slave devices through a single bus that helps to use complicated circuits. It is helpful to connect or disconnect any device on the bus and is good to use for different applications.
Arbitration and Clock Synchronization:
- There is an arbitration option that exists for choosing master control for the bus since comes with multi-master features. It helps to start transmission for a single master avoiding any intersection of data. Clock synchronization features help devices to communicate at different clock speeds.
7-bit and 10-bit Addressing:
- I2C is compatible with 7 and 10-bit addressing and helps to use 128 or 1024 devices address. It is beneficial for the connection of a larger number of devices on a single bus, and increasing the reliability of the system.
Error Detection:
- For errorless communication between devices, there are acknowledgment (ACK) and not acknowledgment (NACK) signals used for data transferring. This error detection process provdie quality transmission and if any error occurs can be solved instantly by I2C communication.
Variable Data Rates:
- I2C has support for different types of data such as Standard mode (100 kbps), Fast mode (400 kbps), Fast mode plus (1 Mbps), and High-Speed mode (3.4 Mbps). So different data rates can be used for different applications.
Low Power Uses:
- 2 wire interfacing helps to use low-power so best for use in battery-operating devices like IoT devices and wearable electronics.
Working of I2C Protocol
- In I2C communication data is transmitted in the form of messages then the message is converted in frames of data. In every message address frame exists which consists address of the resultant slave in the form of binary that also has data frames where data exists and has to be transferred.
- Different conditions such as start, stop, read-write bits, and ACK/ NACK also exist in the message for every data frame can seen here
- Start condition: In this state, SDA wires switch from high to low volts as SCL changes from high to low
- Stop condition: In this state, SDA changes low to a high state after SCL switches from low to high.
- Address Frame: The seven or ten-bit series is different for every slave device which locates the slave devices when the master makes a connection to it.
- Read/Write Bit: On bit identify that the master is transmitting the data to the slave or getting from it.
- ACK/NACK Bit: Every frame existing in the message has an acknowledged/no acknowledge bit. If the address frame gets ACK bit goes back from the receiver point to the sending point
Data Transmission through I2C Protocol
- Some steps are followed for data transmission.
- Master devices transmit the start condition to each slave device connected to it by switching SDA high to low and then switching SCL high to low.
- The master device transmits the seven or ten-bit address to the slave device wanted to make a connection with the master through read/write bit
- Every slave device makes a comparison between the address received from the master device to its address. When conferring the addressed slave send ACK bit through getting SDA lie low for a single bit. If these two addresses do not match salve left the SDA line to a high
- Master transmit and get the data frame
- When every data frame is transmitted receiving module returns one more ACK bit to the sender to know the correctness reception of a frame
- For stop, the transmission of data master transmits the stop condition to the slave by switching SCL high and then sending the SDA high
I2C Applications
- The main applications of I2c are discussed here.
- It helps to access real-time clock and NVRAM.
- It is used for accessing the low-speed DAC and ADC
- It used to control different sensors
- It is used for on and off the power supply.
- It also changes the speaker volume
I2C Advantages
- I2C advantages are listed here
- It is a commonly used transmission protocol
- Its circuit is less complicated than UART
- It can support numerous masters and slaves
- It has two wires
I2C Disadvantages
- Its main drawback is listed here
- Its structure is more difficult than the SPI to apply
- The data size is eight bits
- The data transmission rate is slower than the SPI
I2C vs SPI
I2C
- It is half duplex communications
- It supported multiple masters and multiple slaves.
- it has a wire protocol
- It supported clock stretching
- Slow speed then SPI
- It has extra overheating start and stop bits.
- It comes with acknowledged bits
- it uses pull-up resistors
SPI
- It is full duplex communication.
- It supports single-master.
- SPI is a four-wire protocol.
- SPI does not come with clock stretching.
- SPI does not have start and stop bits.
UART vs I2C vs SPI
Protocol | I2C | SPI | UART |
Complexity | Easy to connect multiple devices | Complex for a larger device | Simple |
Duplex | Half Duplex | Full Duplex | Full Duplex |
masters and slaves | Multiple slaves and masters | 1 master, many slaves |
Single to Single
|
Speed | high than UART | Fastest | Slowest |
Number of devices | 127, | Many, become complex |
Up to 2 devices
|
Number of wires | 2 | 4 | 1 |
Faqs
What is a characteristic of I2C communication?
- I2C supports different data speeds such as standard mode 100kbps, fas mode 400 kbps, High-speed mode (3.4 Mbps), and Ultra Fast-mode (5.0 Mbps) I2C communications. It also comes with Built-in collision detection. 10-bit Addressing.
Which protocol is better I2C or SPI?
- For high-speed data transmission, SPI is the best option since it has full duplex communication and high data rates. If the speed needed is moderate and simple structured need then use I2C
Is UART or I2C better?
That is details about the I2C if you have any further details ask in comments. Thanks for reading have a nice day.