On 06/30/2012 02:56 PM, Tony Duell wrote:
I2C (Inter-IC Communication) is a Philips serial bux
using 2 signals
(clock and data). It was origianly designed to send control infformation
to the ICs in a TV set or whehrever (so the microcontorlelr could send
the contrast value to the video decoder chip, send the teletext page
numbner ot that decoder, etc). It's varily low-speed, but fast ewnough
for that. More useuflly there are some general-purpose ICs iwht I2C
interfaces -- 8 bit paralle I/O, ADCs, DACs, etc
SPI is an older (and IMHO inferiour) serial conmmunicatio nstandard for
things like ADCs, DACs, etc. One differnece is that I2C includes
addressing (you need nothing other than the clock and data lines), while
SPI has clock, data in, data out and select lines, the last being a
separate signal for each IC (hende '2 chip selects' implies only 2 SPI
peripherals.
I use both regularly. SPI is inferior in some ways, but superior in
others. I personally prefer I2C, but there are situation in which SPI
is a better choice. It is MUCH faster (I2C tops out at 400KHz, I've
seen SPI up in the several-MHz range), and I2C's transfer size is fixed
at eight bits, while SPI can transfer arbitrary word widths. (this is
handy for, say, ADCs and DACs).
I2C, however, uses in-band addressing so it saves board space and I/O
pins over SPI.
So, while I personally prefer I2C, I believe it is incorrect to
consider SPI to be inferior, since it they both have their strengths and
weaknesses. The industry agrees, as both have been around for decades
and are still considered de-facto standards for local low-speed
communications. (I first used I2C on a Philips 87C751 microcontroller on
a gov't related project in 1991, and it was well-established even then!)
-Dave
--
Dave McGuire, AK4HZ
New Kensington, PA