I2C Introduction PDF Print E-mail
Written by Administrator   
Sunday, 17 May 2009 00:29


I2C Intro


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.


I2C Basics

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.


I2C Features

  • Only requires two open collector I/O lines.
  • Software is very simple for baseline implementation - no problem to write your own.
  • Can easily talk to up to 127 devices with those two I/O lines, more if you want to implement more detail.
  • A major industry standard.  Parts available from a huge variety of manufacturers.
  • No tight specs on the signal wires, usually just PCB traces or wires etc.
  • 100 kbps, 400kbps, and 3.4 Meg/sec transfer rates possible. (100kbps is easy)
  • No worries about CPU keeping up - Master controls clock for each bit.

Next ->








Last Updated on Sunday, 17 May 2009 13:39

Sponsored Links

Bold Inventions, Powered by Joomla!; Joomla templates by SG web hosting