|Written by Administrator|
|Sunday, 17 May 2009 00:29|
What is I2C?
I2C is a serial bus interface developed by Philips , originally conceived as a way for parts inside a TV to communicate with a minimum of wires, it has spread and become an industry standard. I2C is an extremely simple protocol for communicating with other chips using just two signal wires. This is interesting to embedded systems engineers, because it is relatively simple to implement I2C in software. The above graphic shows some examples of what can be added to an embedded CPU with just two wires and a few lines of code. There is another interface spec which is almost the same called SMBus. The rating for the wiring might be somewhat different, and SMBus has restrictions to implement timeouts, plus various other differences. But they are so close that many consider them interchangeable.
The I2C bus is a serial bus consisting of two wires, the SCL (clock) line, and the SDA (data) line. Obviously, the data bits are shifted in and out on the SDA line, while the SCL line provides the clock so all devices know when to sample the bits in the SDA line. Unlike RS232, there are no fixed baud rates, so the clock does not have to be regular.
In the simplest situation, one part is a master, and it can send data to (or receive data from) any slave on the two-wire bus. Each part on the bus has a unique address, so when the master requests a transaction, only one device responds. It is very easy to write a simple software implementation which will allow a CPU to communicate with I2C slave parts, if you don't bother implementing multiple-master arbitration etc.
The protocol has more advanced features also. There is a system for having multiple masters on the bus, and advanced addressing to allow more than 127 devices. However, for the simple project, most of the benefit of I2C can be realized by only using the dirt-simple baseline implementation.
|Last Updated on Sunday, 17 May 2009 13:39|