I always confuse I²C and SPI, so I decided to create this comparison, and threw in 1-Wire for good measure.
Inter-Integrated Circuit Protocol
Two Wire Interface (TWI)
|Serial Peripheral Interface|
|Signals||1-Wire (Data and parasite power)||
SCL (Serial Clock)
SDA (Serial Data)
SCLK (Serial Clock)
MOSI (Master Out, Slave In)
MISO (Master In, Slave Out)
SS (Slave Select)
|Multiple masters?||No||Yes (if all masters support it)||No|
|Slave adresses||Unique, 64 bits||7 or 10 bits||None (one SS-line pr device)|
|Max range||>100m||2-3m||0.5m (longer at lower speeds)|
Not CLK driven - uses timed pulses.
Often 100kHz or 400kHz.
1MHz, 3.4MHz and 5MHz are specified but rarely used.
|10MHz full duplex|
|Bus driver||Open drain||Open drain||Push/Pull/Tri-state|
|Notes||Some slaves can be powered by the 1-Wire data line. Other devices are powered by a normal VCC.||SMBus (defined by Intel in 1995) is a subset of I²C, defining a stricter usage.||Different devices use different clock polarities (CPOL) and clock phase (CPHA) settings.|
Overview of 1-Wire Technology and Its Use
Guidelines for Reliable Long Line 1-Wire Networks
SparkFun I2C Tutorial
SparkFun SPI Tutorial
Better SPI Bus Design in 3 Steps