What is a Controller and Target in an I2C Bus?
The I2C standard has changed the “master” and “slave” terminology to “controller” and “target” as proper notation.
When the word “Controller” is used, we refer to the “master” device in the I2C bus.
When the word “Target” is used, we refer to the “slave” device in the I2C bus.
An I2C controller is the primary device for “controlling” the bus. The controller provides the clock signal that keeps the communication across the bus synchronous (the clock syncs the data and keeps all devices in time). An I2C target is a peripheral device the fulfills some specialty function on the bus.
Some examples of I2C targets include:
Temperature Sensors
Humidity Sensors
Pressure Sensors
Light Sensors
Real-Time Clock for consistent time references
ADC - analog to digital converters
Port expanders or GPIO expanders
and much more
An I2C Controller and I2C Target in point-to-point communication
The I2C controller is responsible for sending out device addresses in order to select a target device on the bus. Since this is a bus system, multiple targets can exist on the same bus with different addresses. The controller must distinguish between multiple target devices by their device address in order to keep communication orderly.
You can think of a device address as a “name” to a specific target on the bus. For example, there could be two different temperature sensors in a PC. One measures the temperature near the battery (0x20). One sensor measures the ambient temperature of the room that the PC is in (0x21). The controller can talk to the second sensor by sending device address 0x21 in order to communicate with that specific temp sensor.
A controller that sends device address 0×21 will talk to the I2C target with the same address.
S = Start Condition
Sr = Repeated Start Condition
P = Stop Condition
The controller is responsible for sending the starting and stop conditions in an I2C data sequence. Every data transaction begins with a start condition (S) by the controller.
Sometimes the controller may want to repeatedly control the I2C bus. The controller can send a repeated start condition (Sr) in order to maintain control of the bus. Sometimes, two or more controllers can exist in an I2C system where control of the I2C bus is divided between two or more controllers. Thus, the repeated start (Sr) comes in handy for uninterrupted data communication for a single controller.
When communication is done, the I2C controller can issue a stop condition (P).
The UM10204 I2C standard specification by NXP is a 62 page document containing all the necessary information needed for understanding the I2C - inter-integrated circuit standard. For more detailed information, see the attached link.