i2c

26
Mr.Tejas Dave Chovatiya Ravi Jitendra Edle Sachin Nigam Prepared by:- Guide by:- “I2C Bus Protocol Implementation” THAKUR INSTITUTE OF CAREER ADVANCEMENT

Upload: rchovatiya

Post on 14-Jun-2015

3.699 views

Category:

Documents


6 download

DESCRIPTION

This is my DVLSI Project Presentation on I2C Protocol.

TRANSCRIPT

Page 1: I2C

Mr.Tejas DaveChovatiya RaviJitendra EdleSachin Nigam

Prepared by:- Guide by:-

“I2C Bus ProtocolImplementation”

THAKUR INSTITUTE OF CAREER ADVANCEMENT

Page 2: I2C

Shorthand for an “Inter-integrated circuit” bus Developed by Philips Semiconductor for TV sets in

the 1980’s I2C devices include EEPROMs, thermal sensors,

and real-time clocks Used as a control interface to signal processing

devices that have separate data interfaces, e.g. RF tuners, video decoders and encoders, and audio processors.

I2C bus has three speeds: Slow (under 100 Kbps) Fast (400 Kbps) High-speed (3.4 Mbps) – I2C v.2.0

Limited to about 10 feet for moderate speeds

What is I2C?

Page 3: I2C

WISHBORNInterface

Prescale Register

Command Register

TransmitRegister

Status Register

ReceiverRegister

Addr000

Addr001

Addr011

Addr100

Addr101

Addr110

Data IOShift

Register

Bit & Byte Controller

ClockGenerator

SDA

SCL

Internal structure I2C Master Core

Page 4: I2C

External connection

Page 5: I2C

Register ListName Addres

sWidth Access Description

PRERlo

000 8 RW Clock Prescale Register Lo-byte

PRERhi

001 8 RW Clock Prescale Register Hi-byte

CTR Null 8 RW Control Register

TXR 101 8 W Transmit Register

RXR 110 8 R Receive Register

CR 011 8 W Command Register

SR 100 8 R Status Register

Page 6: I2C

Control register

Page 7: I2C

Transmit Register

Receive Register

Page 8: I2C

Command Register

Page 9: I2C

Status Register

Page 10: I2C

I2C Bus Configuration

2-wire serial bus – Serial data (SDA) and Serial clock (SCL)

Half-duplex, synchronous, multi-master bus No chip select or arbitration logic required Lines pulled high via resistors, pulled down

via open-drain drivers (wired-AND)

Page 11: I2C

I2C Protocol

1. Master sends start condition (S) and controls the clock signal

2. Master sends a unique 7-bit slave device address3. Master sends read/write bit (R/W) – 0 - slave receive, 1

- slave transmit4. Slave with matching 7-bit device address always sends

acknowledge bit (ACK) 5. Transmitter (slave or master) transmits 1 byte of data

Page 12: I2C

I2C Protocol (cont.)

6. Receiver issues an ACK bit for the byte received7. Repeat 5 and 6 if more bytes need to be transmitted8. Master always sends stop condition (P)

a. For write transaction (master transmitting), master issues stop condition (P) after last byte of data.b. For read transaction (master receiving), master does not acknowledge final byte, just issues stop condition (P) to tell the slave the transmission is done

Page 13: I2C

Start – high-to-low transition of the SDA line while SCL line is high

Stop – low-to-high transition of the SDA line while SCL line is high

Ack – While transmitter allows SDA to float, the receiver pulls SDA low throughout the entire next clock pulse on SCL.

Data – transition takes place while SCL is low and is valid while SCL is high

I2C Signals

Page 14: I2C

Bit Command Controller

I

Page 15: I2C

A B

I2C SignalsC D I

Page 16: I2C

Write 1 byte of data to a slave

Generate start command Write slave address+write bit Receive acknowledge from slave Write data Receive acknowledge from slave Generate stop command

Page 17: I2C

Read 1 byte of data to a slave

Generate start command Write slave address+write bit Receive acknowledge from slave Write data Receive acknowledge from slave Generate stop command

Page 18: I2C

Receive acknowledge from

slave Generate repeated start signal Write slave address + read bit Receive acknowledge from

slave Read byte from slave Write no acknowledge to

slave,indicationg end of transfer

Generate stop signal

Page 19: I2C

I2C Features “Clock stretching” – when the receiver needs more

time to process a bit, it can pull SCL low to keep it from going high a bit longer. This technique is called clock stretching . On SDL low, the transmitter can send its next data value, but this value will not be interpreted as a valid data symbol by the receiver until after the slave is ready to release SCL to go high.

“General call” broadcast – addresses every device on the bus

10-bit extended addressing for new designs. 7-bit addresses all exhausted

Page 20: I2C

Start countinglow period

waitstate

Start countinghigh period

SCL1

SCL2

SCL

Master1 SCL

Master2 SCL

wired-AND SCL

Clock Synchronization

If two or more masters simultaneously try to control the bus, a clock synchronization procedure determines the bus clock.

Because of the wired-AND connection of the I2C signals a high to low transition affects all devices connected to the bus.

Page 21: I2C

Master :- Initiate a message Slave :- Response to message

Multiple Devices

Page 22: I2C

Master detect arbitration loss

Multi-Master Support

Page 23: I2C

Reduce IC Pins, Cost and Area Reduce PCB Size And Cost

Advantages Of I2C

AppzStock
Page 24: I2C

WISHBORNInterface

Prescale Register

Command Register

TransmitRegister

Status Register

ReceiverRegister

Addr000

Addr001

Addr011

Addr100

Addr101

Addr110

Data IOShift

Register

Bit & Byte Controller

ClockGenerator

SDA

SCL

Internal structure I2C Master Core

Page 25: I2C

References

I2C: http://www-us2.semiconductors.p

hilips.com/acrobat/various/

I2C_BUS_SPECIFICATION_1995.pdf

http://www.esacademy.com/faq/i2c/index.htm

http://www.embedded.com/story/OEG20020528S0057

Page 26: I2C