2025-12-21
I²C is a two-wire serial communication protocol utilizing a serial data line (SDA) and a serial clock line (SCL). This protocol supports connecting multiple target devices on a single communication bus and also enables multiple controllers to send and receive commands and data. Communication occurs in the form of packets, each containing byte information and the unique address of each target device.
I. Historical Overview
I²C (IIC) stands for “Internal Integrated Circuit Protocol.” Developed by Philips Semiconductors (now NXP Semiconductors) in 1982, this low-speed communication protocol connects controller devices such as microcontrollers and processors to target devices like data converters and other peripherals. Since 2006, implementation of the I²C protocol has been royalty-free, and numerous semiconductor companies, including Texas Instruments (TI), have released I²C-compatible devices. I²C has become a widely adopted protocol for several reasons. It requires only two signal wires for communication: similar to other serial protocols, it consists of a serial data line and a serial clock line. I²C connects multiple devices on the bus using only these two wires. The controller device communicates with any target device by sending its unique I²C address over the serial data line. For device manufacturers, I²C offers a simple and cost-effective implementation solution.
II. Fundamental Knowledge Points
- Typically used in microcontroller applications such as LCD and LED drivers, remote I/O ports, RAM, EEPROM, real-time clocks, or A/D and D/A converters.
- it requires only two wires—a serial data line (SDA) and a serial clock line (SCL).
- It supports one master and multiple slaves, enabling communication through unique address identification. It is important to note that a pull-up resistor must be connected to each of the SCL and SDA lines to ensure signal integrity. This maintains a high logic level during idle periods.
III. Diagram
A key feature of the I²C system is that all devices on the bus share two communication lines. These lines support bidirectional, half-duplex communication. I²C enables the connection of multiple controllers and multiple target devices. Pull-up resistors are required on both lines (as mentioned earlier).




The I²C protocol is divided into multiple frames for transmission. Communication begins with an address frame sent by the controller device after issuing a start (START) condition. The address frame is followed by one or more data frames, each containing one byte. Each frame also includes an acknowledgment bit to inform the controller that the target device or the controller itself has successfully received the data.

Each I²C target device has a corresponding I²C address. When initiating communication with a specific target device, the controller uses that device’s address to send or receive data in subsequent I²C frames. I²C addresses consist of 7 bits, and each device on the bus has a unique address.
A 7-bit address implies 2^7 (i.e., 128) unique addresses. However, several reserved I²C addresses exist, limiting the actual number of connectable devices. Addresses are transmitted using SDA as the data line and SCL as the serial clock line. With this understanding, one can interpret a device’s I²C communication data and comprehend the content transferred between the controller device and the target device. The eighth bit of the frame following the address is the read/write bit. If this bit is set to 1, the controller requests data from the target device. If this bit is set to 0, the controller requests to write data to the target device.

I²C communication begins when a controller device issues an I²C start condition. If the bus is idle, an I²C controller can acquire the bus by sending a start condition. Specifically, the controller device first pulls the serial data line (SDA) low, followed by pulling the serial clock line (SCL) low. This sequence indicates the controller device is requesting bus access for communication and forces other controllers on the bus to pause their operations. Upon completing its communication, the controller device releases SCL to a high level before releasing SDA to a high level. This creates an I²C stop condition. This action releases the bus, allowing other controllers to communicate or enabling the same controller to establish communication with other devices.

I²C uses a sequence of 1s and 0s for serial communication. The serial data line (SDA) transmits data bits, while the serial clock line (SCL) provides timing for the bit sequence. When the SDA line is released and pulled high by a pull-up resistor, it indicates transmission of a logic “1”. When the SDA line is actively pulled low to a level near ground, it indicates transmission of a logic “0”.
Data bits (1 or 0) are sampled and received during the active period of the SCL pulse. To ensure a data bit is valid, the corresponding SDA signal must remain stable between the rising and falling edges of SCL. If SDA changes during the high level of SCL, it may be interpreted as a START or STOP condition on the I²C bus. An additional ninth bit is used after any communication byte (including address and data bytes) to verify successful communication. At the end of the address byte transmission, the target device pulls SDA low during an SCL pulse to indicate to the controller that the address was received. This is called the acknowledgment bit. If this bit is high, it indicates no target device received the address, resulting in communication failure. This condition is termed NACK (No Acknowledgment).
Following the address frame are one or more data frames. These data frames transmit one byte at a time. After each data byte is transmitted, a similar acknowledgment bit is generated. If the data byte is a write operation to the device, the target device pulls SDA low to acknowledge the transmission. If the data byte is a read operation from the device, the controller pulls SDA low to acknowledge receipt of the data. The ACK bit serves as a valuable debugging tool. Its absence may indicate that the target peripheral did not receive the correct I²C communication address, or that the controller peripheral did not receive the expected data.
Upon completing communication, the controller issues an I²C stop condition: SCL is released first, followed by SDA. The controller uses the stop condition to signal the end of communication and release the I²C bus.


IV. Practical Application (Peripheral Register Configuration)
For example, the ADS1115 device includes a 16-bit configuration register. Writing to this register both configures the device and initiates a conversion. The figure shows the data field layout of the configuration register, listing each function within the register and its corresponding bit position. After determining all settings for the configuration register, it is set via a single I²C write operation.
The following table provides descriptions of each field in the configuration register and detailed explanations of the bit settings.

Starting from the most significant bit:
Bit 15 is the single-conversion enable bit.
Bits 14 through 12 are used to configure the device’s multiplexer. In this example, the device is set to perform a single-ended measurement relative to ground on AIN0. In the configuration register, the positive input must be set to AIN0 and the negative input to GND. To achieve this, bits 14 through 12 are set to the binary number 100.
Bits 11 through 9 configure the device’s Programmable Gain Amplifier (PGA). This setting determines the full-scale range of the input measurement—the maximum amplitude of the input signal the ADC can measure. Configure the ADC to measure signals up to ±4.096V. Set bits 11 through 9 to the binary value 001.
Bit 8 configures the device’s operating mode. For this operation, set the device to single-shot conversion mode by setting bit 8 to 1.
Bits 7 through 5 configure the device’s ADC data rate. This is set to the maximum rate of 860 SPS (samples per second). Bits 7 through 5 are set to 111.
Bit 4 to bit 0,the final five bits control the device’s digital comparator. The digital comparator is not used in this example and is disabled via the last two bits of the register (bits 1 and 0). The remaining bits (bits 4 through 2) retain their default settings. Therefore, set bits 4 through 0 to the binary value 00011. These binary bits will be used to execute the register write operation. This register configuration can also be represented in hexadecimal as C3E3h. To write this configuration to the device, follow the same target device write procedure using the write format with the timing shown below.

Similarly, if a peripheral supports read operations, the corresponding operating timings will be specified in the device datasheet. Note that the I²C standard protocol does not impose these mandatory constraints; actual implementation should be based on the peripheral’s specific support.
