Connecting multiple I2C devices on a common bus

The I2C communication protocol is so popular today that you can buy varieties of I2C-compatible devices in the form of temperature sensors, serial EEPROMs, real-time clocks, LCD drivers, port expanders, and so on. While most modern microcontrollers do have built-in I2C communication ports, its implementation requires a good understanding of the protocol in general, its signal types, and an addressing scheme for uniquely identifying multiple devices on a common I2C bus. Embedded Lab’s new tutorial on I2C communication covers all the detail that is required for connecting multiple devices on a common I2C bus.

The tutorial uses the PIC18F2550 microcontroller, to which is connected three I2C compatible devices: 2 EEPROMs (24LC512) and one temperature sensor (DS1631). In the experiment, the microcontroller receives the temperature readings from DS1631 sensor and stores them in the two EEPROMs. Later, the readings are retrieved from the EEPROMs and displayed on an LCD screen.

More about I2C capabilities

The number of I2C devices that can be connected to a microcontroller depends on the number of available I2C bus lines, the addressing scheme used by the devices, and the total capacitance of the bus.

The I2C bus allows for multiple slave devices to be connected to a single master device. The maximum number of slaves that can be connected to the bus is determined by the addressing scheme used by the devices. In the standard 7-bit addressing scheme, up to 128 slave devices can be connected to a single I2C bus. In the extended 10-bit addressing scheme, up to 1024 slave devices can be connected.

However, increasing the number of slaves on an I2C bus can cause some problems. One issue that can arise is signal degradation due to the increased capacitance on the bus. Each additional slave device added to the bus adds capacitance, which can cause signal distortion, reduced signal integrity, and timing issues. This can result in communication errors or data loss.

Another problem that can arise with an increasing number of slaves is bus arbitration. The I2C bus uses a master-slave protocol where the master device initiates communication with the slave devices. In case two or more slave devices try to respond at the same time, an arbitration process takes place to determine which device should respond first. As the number of slaves increases, the arbitration process can take longer, impacting the bus’s overall performance.

In summary, the number of I2C devices that can be connected to a microcontroller depends on the available I2C bus lines, the addressing scheme used, and the total capacitance of the bus. However, increasing the number of slaves on an I2C bus can lead to issues such as signal degradation and bus arbitration problems. It’s essential to carefully consider the number of slaves that will be connected to an I2C bus and implement appropriate measures to mitigate these issues.

One Comment:

  1. I have connected Two AT24C512 devices to 89C51 controller.. But have problems with writing to the 2nd device who A0 address line I have pulled High thr a 10K resistor.
    What could be probable reasons.
    Can u advise and suggest check points.
    S Shah

Comments are closed