I2C refers to Inter-Integrated Circuit, a communication bus invented by Phillips Semiconductors in 1982. The purpose of the bus is to attach peripheral integrated circuits to processors over short distances. It has been widely adopted for embedded systems applications with data transfer requirements below about 400 kbit/second. This is sufficient for many instrumentation requirements.
The communications bus requires two signal lines designated SDA (data)and SCL (clock). Both are open-collector (or open-drain) lines requiring pull up resistors to maintain a quiescent high state. Typical voltages are +5 or +3.3 volts.
An I2C bus can have multiple controllers and peripherals. A controller initiates a data transfer, the peripheral responds. A data transfer is performed as follows:
A controller pulls the SDA line low. The first device on the bus to pull SDA low is the controller. This is the start condition.
The controller then pulls the SCL line low.
The Raspberry Pi Pico provides two independent I2C channels, numbered 0 and 1, that are accessible through the GPIO pins. The following table shows GPIO pin where I2C channel 0 and I2C channel 1 can be accessed.
I2C0 SDA/SCL | I2C1 SDA/SCL |
---|---|
GP0, GP1 | GP2, GP3 |
GP4, GP5 | GP6, GP7 |
GP8, GP9 | GP10, GP11 |
GP12, GP13 | GP14, GP15 |
GP16, GP17 | GP18, GP19 |
GP20, GP21 | GP26, GP27 |