The I C Bus
The I C Bus
Internal
2 of 40
Internal
What is I2C
➢ The name stands for “Inter - Integrated Circuit Bus”
➢ A Small Area Network connecting ICs and other
electronic systems
➢ Originally intended for operation on one
single board / PCB
▪ Synchronous Serial Signal
▪ Two wires carry information between
a number of devices
▪ One wire use for the data
▪ One wire used for the clock
➢ Today, a variety of devices are available with I2C
Interfaces
▪ Microcontroller, EEPROM, Real-Timer, interface chips, LCD driver, A/D
converter
3 of 40
Internal
5 of 40
Internal
6 of 40
Internal
7 of 40
Internal
8 of 40
Internal
9 of 40
Internal
SDA
SCL
Data line stable; Change
Data valid of data
allowed
11 of 40
Internal
SDA SDA
SCL SCL
Start Stop
Condition Condition
12 of 40
Internal
I2C Addressing
➢ Each node has a unique 7 (or 10) bit address
➢ Peripherals often have fixed and programmable
address portions
➢ Addresses starting with 0000 or 1111 have
special functions:-
▪ 0000000 Is a General Call Address
▪ 0000001 Is a Null (CBUS) Address
▪ 1111XXX Address Extension
▪ 1111111 Address Extension – Next Bytes are the Actual
Address
13 of 40
Internal
MSB LSB
R / Wr
R/Wr
0 – Slave written to by Master
1 – Slave read by Master
14 of 40
Internal
15 of 40
Internal
Acknowledgements
➢ Master/slave receivers pull data line low for one clock pulse
after reception of a byte
➢ Master receiver leaves data line high after receipt of the last
byte requested
➢ Slave receiver leaves data line high on the byte following
the last byte it can accept
Transmitter releases
SDA line during 9th clock
pulse.
Acknowledgement
from receiver
16 of 40
Internal
Negative Acknowledge
Transmitter releases
SDA line during 9th clock
pulse.
Not acknowledgement
(NACK) from receiver
17 of 40
Internal
SDA
SCL
Remember : Clock is produced by Master
Start Stop
18 of 40
Internal
Data Formats
➢ Master writing to a Slave
A A A
19 of 40
Internal
20 of 40
Internal
21 of 40
Internal
➢ As the data line is like a wired AND, a ZERO address bit overwrites a ONE
➢ The node detecting that it has been overwritten stops transmitting and
waits for the Stop Condition before it retries to arbitrate the bus
22 of 40
Internal
Error Checking
➢ I2C defines the basic protocol and timing
▪ Protocol errors are typically flagged by the interface
▪ Timing errors may be flagged, or in some cases could be
interpreted as a different bus event
➢ Glitches (if not filtered out) could potentially
cause:
▪ Apparent extra clocks
▪ Incorrect data
▪ “Locked” bus
➢ Microprocessors communicating with each other
can add a checksum or equivalent
23 of 40
Internal
Bus Recovery
➢ An I2C bus can be “locked” when:
▪ A Master and a Slave get out of synch
▪ A Stop is omitted or missed (possibly due to noise)
▪ Any device on the bus holds one of the lines low
improperly, for any reason
▪ A shorted bus line
➢ If SCL can be driven, the Master may send extra
clocks until SDA goes high, then send a Stop.
➢ If SCL is stuck low, only the device driving it can
correct the problem.
24 of 40
Internal
25 of 40
Internal
26 of 40
Internal
Thank you
27 of 40