I²C (Inter-Integrated Circuit), pronounced I-squared-C or I-two-C, is a multi-master, multi-slave, packet switched, single-ended, serial computer bus.
- Wikipedia Article
- I2C Bus Specification
- NXP I2C Portfolio - extensive range of I2C ICs, sensors, etc.
The I2C standard is based on 5V, but most devices these days are designed to work between 3.3V and 5V due to the growing trend towards lower power devices.
The UX2 Bus is based on an operating voltage of 3.3V and would likely be damaged by higher voltages.
If you encounter an I2C device that requires 5V, you can use a Level Shifter to safely interface to it.
If there is a risk of voltage spikes, you can use a Power Isolator which can protect against voltages up to 1KV.
UX2-GPIO – 1 x I2C, 4 x GPIO, 1 x UART, 1 x SPI:
UX2-1IS – 1 x I2C, 1 x 1-WIRE, 1 x INTERRUPT, 1 x UART, 1 x SPI, 1 x SOUND-WIRE:
UX2-ALT – 2 x I2C, 2 x GPIO, 1 x UART, 1 x SPI:
UX2-I2C – 3 x I2C, 1 x UART, 1 x SPI:
The I2C standard uses 4 wires; SDA
(data), SCL
(clock), 3V3
and GND
:
UX2 | I2C |
---|---|
SDA (data) |
|
SCL (clock) |
|
VCC |
|
GND |
It's important to use the same interface pair for each I2C bus. For example, if you're using the UX2-I2C pin variant which provides 3 x I2C interfaces, you could use SDA1
and SCL1
together as a pair, but not SDA1
and SCL2
(SCL2
must be paired with SDA2
).
Each interface pair (I2C Bus) can host multiple slave devices. Usually one I2C bus will suffice, but it can be useful to use more than one, for example if two devices have the same address you can put them on separate busses.
An I2C bus can have several devices attached to it in a linear topology:
There are multiplexer and switch ICs which provide more advanced topologies should the need arise.
The maximal number of nodes is limited by the address space and also by the total bus capacitance of 400 pF, which restricts practical communication distances to a few meters.
There are ICs which change I2C address to help overcome cases where multiple devices with the same address are required.
You can extend the range of an I2C network using an Extender Module (essentially a repeater node) or even with some clever, wiring.
- UX2 Overview
- Protocols
- SMBus – almost completely compatible with I2C.
- Modules