Book Image

Learning Beaglebone Python Programming

Book Image

Learning Beaglebone Python Programming

Overview of this book

Table of Contents (19 chapters)

I2C


In the I2C protocol, there's a master device controlling one or more slave devices using two digital signals. One of the signals is a clock, called Serial Clock (SCL), and the other is a bidirectional data line, called Serial Data (SDA). The clock signal is generated by the master, which means the devices don't need to be programmed with the same symbol rate like UARTs do.

To handle multiple devices, each slave device on the same bus (sharing the same SDA and SCL signals) must have an individual address. The standard I2C protocol uses 7-bit slave addresses, meaning there can be up to 27 = 128 devices on a single bus. There are 16 addresses reserved for special purposes, so that leaves room for 112 general I2C devices per bus. A device's address is programmed into it by its manufacturer, and there is no guarantee that any two devices won't have the same address, so in practice, the upper limit would likely be less than 112. Some devices have a single hardcoded address and some devices...