Inter-IC communication bus (I2C bus) is a serial data bus that was originally developed at Phillips Semiconductors. It is used for communications between integrated circuits (ICs) or modules. The bus allows data and instructions to be exchanged between devices by means of just two wires. This results in a considerable simplification of circuits.
Let’s assume we have a number of device circuits in a number of processes in a plant, one IC each for measuring temperatures and pressures. We would employ I2C common synchronous serial bus to mutually network these ICs.
As mentioned above, the I2C bus has two lines that carry its signals – one line is for clock (SCI) and one is for bidirectional data (SDA) as illustrated in the figure below:
Both lines are connected to the positive power supply via pull-up resistors, this is done so to ensure that both lines are at a HIGH level when the bus is free and ensure that the signals are pulled up from a LOW to a HIGH level within the required rise time, hence taking account of the bus capacitance. The bus capacitance is the total capacitance of wire, connections and pins. The bus capacitance limits the maximum value of the pull-up resistance due to the specified rise time. The supply voltage limits the minimum value of the pull-up resistance due to the specified minimum sink current of 3 mA for standard mode.
Masters can operate as master transmitters or master receivers. Each device connected to the bus is software addressable by a unique address. The master can address 127 other slaves at an instance. It has a processing element functioning as a bus controller or a microcontroller with I2C bus interface circuit. Each slave can optionally have an I2C bus controller and processing element. A number of masters can also connect to the bus. However, at any instance, there can be only one master, which is one that initiates a data transfer on SDA (serial data) line and which transmits the SCL (serial clock) pulses.
From the master or slave, a data frame has fields beginning from start bit as per table below:
Table 1
Field & Its Length | Description |
First field of 1-bit | It is start bit similar to the one in a UART. |
Second field of 7 bits | It is referred to as the address field. It defines the slave address being sent the data frame (of many bytes) by the master. |
Third field of 1 control bit | It defines whether a read or write cycle is in progress. |
Fourth field of 1 control bit | Next bit defines whether present data is an acknowledgement (from the slave). |
Fifth field of 8 bits | It is used for IC device data bits. |
Sixth field of 1-bit | It is negative acknowledgement bit (NACK) from the master. If active, then acknowledgement after a transfer is not needed from the slave, else acknowledgement is expected from the slave. |
Seventh field of 1-bit | It is a stop bit like in a UART. |
The following protocol is used:
An example of I2C compatible IC is the Microchip TC74 (a temperature sensor).
You may also read:
The world of electronics is constantly evolving, allowing designers and manufacturers to push the boundaries…
PIC microcontrollers are fabricated by Microchip Technology. PIC16C84 and PIC16F84 are the two microcontrollers in…
The ADD instruction tells the microcontroller’s CPU to add the source byte to register A…
8-bit microprocessors are limited in their speed (the number of instructions that can be executed…
The 68HC11 (also abbreviated as 6811 or HC11) is an 8-bit microcontroller that was introduced…
Mutual exclusion typically imposes some conditions on access to a given resource by two or…