Sie sind auf Seite 1von 4

I2C (Inter-Integrated Circuit Communication) The Inter-Integrated Circuit (I2C) Bus developed and patented by Philips, is a simple, low-cost

serial interface for connecting one or more microcontrollers and peripherals in an embedded system. The I2C Bus defines the signals, data formats, and protocols necessary for devices to communicate. Basic Operation: A typical I2C Bus configuration is shown in Figure. The I2C Bus defines two signals (wires), SDA for serial data and SCL for serial clock, to carry information between devices. Each device is identified by a unique address.

Each device can either transmit data or receive data. A device operates as either a master or as a slave. A master initiates data transfer, either to or from one or more slaves, and generates clock signals. The I2C Bus supports multiple masters, i.e. more than one device is capable of controlling the bus. The I2C Bus includes an arbitration scheme so that correct operation will occur if more than one master wants to use the bus at the same time. Data Format: Start Condition 7-bit Slave Address R/W ACK Data ACK Data ACK Stop Condition

Start & Stop Conditions: Within the procedure of the I2C-bus, unique situations arise which are defined as START (S) and STOP (P) conditions. A HIGH to LOW transition on the SDA line while SCL is HIGH is one such unique case. This situation indicates a START condition.

A LOW to HIGH transition on the SDA line while SCL is HIGH defines a STOP condition. START and STOP conditions are always generated by the master. The bus is considered to be busy after the START condition. The bus is considered to be free again a certain time after the STOP condition.

Acknowledge: An acknowledgment bit (A) must be sent after each byte is received. The master generates the clock pulse on SCL for the acknowledge bit, while the data receiver generates the acknowledge bit on SDA. The transmitter must release SDA (high output) during the acknowledge clock pulse.

Complete Data Transfer Below figure shows a data format for an I2C Bus transaction. The unit of information including start condition, address, data, acknowledgment, and stop condition is sometimes referred to as a frame and constitutes an atomic transfer as defined for the I2C Bus.

After the START condition (S), a slave address is sent. This address is 7bits long followed by an eighth bit which is a data direction bit (R/W) - a zero indicates a transmission (WRITE), a one indicates a request for data (READ). A data transfer is always terminated by a STOP condition (P) generated by the master. However, if a master still wishes to communicate on the bus, it can generate a repeated START condition (Sr) and address another slave without first generating a STOP condition. Various combinations of read/write formats are then possible within such a transfer. Possible data transfer formats: 1. Master-transmitter transmits to slave-receiver. The transfer direction is not changed.

2. Master reads slave immediately after first byte. At the moment of the first acknowledge, the master-transmitter becomes a master-receiver and the slave-receiver becomes a slavetransmitter. This first acknowledge is still generated by the slave. The STOP condition is generated by the master, which has previously sent a not-acknowledge (NA).

3. Combined format. During a change of direction within a transfer, the START condition and the bit slave address are both repeated, but with the R/W reversed. If a master receiver sends a repeated START condition, it has previously sent a not-acknowledge (A).

Das könnte Ihnen auch gefallen