I2C Primer

In order to use the I2C bus properly and efficiently, it is important to understand what happens in the hardware on the electric level. Protocol knowledge alone is not enough: many I2C problems – a bus that hangs, missing acknowledges, distorted signals – can only be traced back to their cause once the electrical behaviour of the lines SDA and SCL is understood. This essay explains:

  • the hardware setup of an I2C bus,
  • the requirements for proper operation of the I2C bus,
  • how to find the cause of problems and how to solve them.

It is assumed that the reader understands the protocol basics of I2C and is thus familiar with terms like I2C master and slave, (repeated) start and stop conditions, and acknowledges. Whenever a term is used for the first time in the following chapters, it is linked to the page where it is explained in detail.

The current I2C specification has the revision 7.0 and is dated October 2021; you can find it right here: https://www.nxp.com/docs/en/user-guide/UM10204.pdf.

The pictures shown in the following sections have been made with Tracii XL 2.0, an I2C interface with analysis functions. The measurements can be reproduced with comparable equipment.

Chapters of this I2C primer

The primer consists of the following chapters. It is recommended to read them in order, since each chapter builds on the previous ones:

If you are hunting a specific symptom, the sections on common problems and obscure problems are a good starting point; the chapter on a blocked bus describes one of the most frequent failure modes in practice.