A comparison of 1-Wire, I²C and SPI

I always confuse I²C and SPI, so I decided to create this comparison, and threw in 1-Wire for good measure.

1-Wire I²C SPI
Name/Alias OneWire Inter-Integrated Circuit Protocol
Two Wire Interface (TWI)
Serial Peripheral Interface
Oprindelse Dallas/Maxim Philips Motorola
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)
Schematics 1-Wire I²C SPI
Multiple masters? No Yes (if all masters support it) No
Multiple slaves Yes Yes Yes
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)
Max FClock 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.
Links Overview of 1-Wire Technology and Its Use
Guidelines for Reliable Long Line 1-Wire Networks
Arduino Playground
SparkFun I2C Tutorial
SparkFun SPI Tutorial
Better SPI Bus Design in 3 Steps

No comments:

Post a Comment