I2C Addressing

How Master selects one specific Slave among 127 possibilities.

7-Bit Addressing (Standard)

The first byte sent after START consists of:

  • Upper 7 bits: The Slave Address.
  • LSB (Bit 0): Integration of Read/Write flag.

Address Calculation

If a datasheet says the address is 0x50:

  • Write Command: (0x50 << 1) + 0=0xA0
  • Read Command: (0x50 << 1) + 1=0xA1

Multi-Master Arbitration

What if two Masters try to talk at the exact same time?

The Rule of Lowest Logic

Since the bus is Open-Drain (Wired-AND), a "0" always wins over a "1".

  1. Both Master A and Master B drive SDA.
  2. They both monitor the SDA line while driving.
  3. If Master A drives "1" but sees "0" (because Master B drove "0"), Master A knows it has lost arbitration.
  4. Master A immediately stops driving and switches to Slave mode (to check if it is being addressed).