I2C-bus Elements SASE March 2010 SASE- March 2010
Alix Maldonado -Technical Marketing Manager Product Line System Management Business Line Interface Products
I 2 C-bus Elements SASE March 2010 SASE- March 2010 Alix Maldonado - - PowerPoint PPT Presentation
I 2 C-bus Elements SASE March 2010 SASE- March 2010 Alix Maldonado -Technical Marketing Manager Product Line System Management Business Line Interface Products Agenda I 2 C-bus Protocol Electrical Characteristics Electrical Characteristics
Alix Maldonado -Technical Marketing Manager Product Line System Management Business Line Interface Products
2
Logic
This means:
Logic
p p
V
VCC
Invented by NXP! (Philips Semiconductors) I2C-bus developed in the late 1970’s for Philips consumer products (e.g. TVs) Worldwide industry standard and used by all major IC manufacturers (Philips Semiconductors) Worldwide industry standard and used by all major IC manufacturers
3
VDD
Pull up resistors SDA SDA SCL Data out Data in Clock out Clock in Data out Data in Clock out Clock in
2 wire bus: – SDA: Serial Data Line
Device 1 Device 2
SDA: Serial Data Line – SCL: Serial Clock Line Open-drain or open-collector output stages: wired-AND function
4
Master2 Slave2
VDD
SDA SCL
Multiple master
Master1 Slave1
Multiple slave Bi-directional – Master-transmitter – Master-receiver – Slave-transmitter – Slave-receiver Data collision is taken care off Data collision is taken care off
5
Each device is addressed individually by software New devices or functions can be easily “clipped" on to an existing bus! 112 different addresses max with the 7-bit format (others reserved); additional 1024 with ( ) 10-bit format Address allocation coordinated by the I2C-bus committee Programmable pins means that several of the same devices can share the same bus f f Unique address per device: fully fixed or with a programmable part through hardware pin's) 10-bit format use a 2 byte message: 1111 0A9A8R/W + A7A6A5A4A3A2A1A0
V
Master1 Slave1
VDD
SDA SCL
VDD
1 1 1 Fixed Hardware Programmable
Address register A6 A5 A4 A3 A2 A1 A0 6
Master
Communication must start with: START condition Start bit is always followed by slave address Sl dd i f ll d b READ NOT WRITE bit
Slave Master or Slave
Slave address is followed by a READ or NOT-WRITE bit The receiving device (either master or slave) must send an ACKNOWLEDGE bit Communication must start with: STOP condition
START SLAVE ADDRESS[7] R/W ACK DATA[8] ACK STOP
Example:
START SLAVE ADDRESS[7] ACK DATA[8] ACK STOP
Transmit (0 = Write)
DATA[8] ACK
Example:
START SLAVE ADDRESS[7] 1 ACK DATA[8] ACK STOP
Receive (1 = Read)
DATA[8] ACK 7
Start condition - a HIGH to LOW transition on the SDA line while SCL is HIGH Stop condition - a LOW to HIGH transition on the SDA line while SCL is HIGH
8
START Slave Address R/W ACK DATA NACK
ACK RE- START/ STOP
9
STOP
START Slave Address R/W ACK DATA NACK
ACK RE- START/ STOP
10
STOP
START Slave Address R/W ACK DATA NACK
ACK RE- START/ STOP
11
STOP
During data transfer, SDA must be stable when SCL is High
12
Each byte has to be followed by an acknowledge bit Number of data bytes transmitted per transfer is unrestricted If a slave can’t receive or transmit another complete byte of data, it can hold the clock line SCL LOW (clock stretching) to force the master into a wait state
13
I2C specification: Data transfer with acknowledge is obligatory. The receiver must pull down the SDA line during the acknowledge clock pulse so that it remains stable LOW d i th HIGH i d f thi l k l during the HIGH period of this clock pulse. Scenarios with a NOT-acknowledge (NACK) (SDA staying HIGH): 1. A receiver with the address is not present in the I2C bus. 2 The receiver is performing real-time tasks and it cannot process the received I2C 2. The receiver is performing real time tasks and it cannot process the received I C information. 3. The receiver is the master and wants to take control of SDA line again in order to generate a STOP command. The slave transmitter MUST then release the SDA line when it sees the NACK so the master can send the STOP command
14
line when it sees the NACK so the master can send the STOP command.
Two or more masters may generate a START condition at the same time Arbitration is done on SDA while SCL is HIGH - Sl i l d
VDD
SDA
Slaves are not involved
DATA1 SDA DATA2 SDA Master 1 Master 2
Summary: The master that first sends a “1” while the other sends a “0” loses control (arbitration)
15
VDD
SCL
Internal counters of masters count the LOW and HIGH times (TL1, TH1) and (TL2, TH2)
CLK1 SCL CLK2 SCL SCL Master 1 SCL Master 2 T T
Wired-AND SCL connection: TL= longest TL= max (TL1, TL2 ,TLn) T shortest T min (T T T )
TL1 TH1 TL2 TH2
TH= shortest TH= min (TH1, TH2,THn)
T T
L2 H2
16
TL TH
Standard Mode Fast Mode Fast Mode Plus (FM+) High Speed Mode (FM+) Bitrate (kBit/s) 0 – 100 0 – 400 0 – 1000 0 – 1700 0 – 3400 Address (bits) 7 (10) 7 (10) 7 (10) 7 (10) 7 (10) Capacitive Bus Load (pF) 400 400 550 400 100
Increased bandwidth
Sink current (mA) 3 3 20 3 3
– Increased bandwidth – Increased transmission distance (at reduced bandwidth: >> 550 pF bus load)
17
Standard Mode Fast Mode Fast Mode Plus (FM+) Bitrate (kBit/s) 0 – 100 0 – 400 0 – 1000 0 – 1700 0 – 3400 High Speed Mode Address (bits) 7 (10) 7 (10) 7 (10) 7 (10) 7 (10) Capacitive Bus Load (pF) 400 400 4000 400 100 Sink current (mA) 3 3 20 3 3 Trise: Rise time (ns) 1000 300 120 160 80 Trise: Rise time (ns) 1000 300 120 160 80 trise V Vcc Vbus (V) VIH V 0.7 * VDD 0 3 * V t (s) VIL VOL 0.3 VDD 0.4 V @ 3 mA sink current 0 4 V @ 20 mA sink current (FM+) gnd t1 t2
18
0.4 V @ 20 mA sink current (FM+)
START HIGH to LOW transition on SDA while SCL is HIGH STOP LOW to HIGH transition on SDA while SCL is HIGH DATA 8-bit word, MSB first (Address, Control, Data):
D h 9th l k l d i th HIGH i d ACKNOWLEDGE
CLOCK
CLOCK p ( )
ARBITRATION
A bit ti i d SDA li
19
20
Acknowledge Data
21
Reserved Addresses
START Slave Address R/W ACK DATA NACK
…
DATA ACK RE- START/ STOP START Slave Address R/W ACK DATA NACK
…
DATA ACK RE- START/ STOP ACK/
22
STOP STOP
µcon- t ll I/O A/D LCD RTC µcon- t ll II SCL troller SDA D/A troller II
New devices or
EEPROM
A0 A1 A2
Fixed Hardware Selectable
New devices or functions can be easily “clipped” on to an existing bus!
23
Consist of fixed address and hardware selectable address (optional), a total of 7-bit R/W bit is sometimes included as part of the address, and is called read or write address)
p , )
Fixed Hardware Selectable pins Only the addressed slave device acknowledges 7-bit address R/W bit is included result in: odd address is always the “read” address, even address is always the “write” address
START Slave Address R/W ACK DATA NACK
…
DATA ACK RE- START/ STOP START Slave Address R/W ACK DATA NACK
…
DATA ACK RE- START/ STOP
1 1 0 0 0 0 0 W
ACK/
24
STOP STOP
Consist of fixed command, 11110 and 10-bit address (fixed or hardware selectable) A write operation takes up two bytes
Command Any 10-bit address slave devices may acknowledge Only the addressed slave device acknowledges Write
A read operation requires a two byte for write followed by a 1 byte read
A read operation requires a two byte for write, followed by a 1 byte read
Write operation Command p Any 10-bit address slave devices may acknowledge Only the addressed slave device acknowledges
25
26
27
F t Hi h Standard Mode Fast Mode Fast Mode Plus High Speed Mode Bit Rate ( kb/ s) 0 to 100 0 to 400 0 to 1000 0 to 1700 0 to 3400 ( kb/ s) Max Load ( pF) 400 400 550 400 100 Rise tim e ( ns) 1000 300 120 160 80
Rise Time
( ns) Noise filter ( ns)
10 10 10
Rise Time
28
SDA data changing state SDA evaluated
29
No ACK
HIGH
ACK
LOW
9th SCL 8th SCL
30
31
NACK
HIGH
ACK
LOW
9th SCL 8th SCL
32
33
– A master performs clock stretch when it needs to slow down the clock in order to accommodate a slower slave device A slave performs clock stretch when it needs to perform other function – A slave performs clock stretch when it needs to perform other function
Clock stretch
34
35
– Result in new clock frequency = longest low + shortest high
– Result in the losing master stop sending data – Losing master can continue to send SCL until the end the byte – Losing master can continue to send SCL until the end the byte – Data is not corrupted
VCC
Master#2
VCC
Master#2
Rpu Rpu
Master#1
Slave Address#1 Slave Address#2
Master#1
Slave Address#1 Slave Address#2
36
Address#1 Address#2 Address#1 Address#2
Vd Vdd CL CLK 1 1 CL CLK 2 2 Ma Mas ter 1 1 Mas ter 2 Vd Vdd Vd Vdd CL CLK 1 1 CL CLK 1 1 CL CLK 2 2 CL CLK 2 2 Ma Mas ter 1 1 Mas ter 2
CL CLK 1 1 CL CLK 2 2 S C S CL CL CLK 1 1 CL CLK 1 1 CL CLK 2 2 CL CLK 2 2 S C S CL
37
Master 1 loses arbitration DATA1 ≠SDA
Start command “1” “0” “0” “1” “0” “1”
38
39
Slave releases SDA line Slave held the line low Slave releases SDA line Slave becomes idle
40
Vdd Master 1 Master 2
TL1 TH1 T1 CLK 2 TL2, TH2 CLK 1 TL1, TH1 SCL TL, TH
T2
TL2 TH2
H1
Internal Counters count the Low and High times (TL1, TH1) and (TL2,
Count TH1 Count TL1
Counting TL1 done Wait State TL2 still counting
CLK1 TH2)
Count TH2
Count TL2
CLK2
Reset Counter High TH2 Start Counting TL2
2
Counting TL2 done Start Counting TH2 SCL goes High
3 4 2 3 4
SCL
TL = TL2 TH = TH1
T = shortest T = min (T T T )
Counting TH1 done Start Counting TL1 SCL goes Low
1
Start Counting TH1 Counting TH1 done Start Counting TL1 SCL goes Low
1 4
41
Master 2 loses arbitration because DATA2 ≠ SDA
DATA1
Master 2 loses arbitration because DATA2 ≠ SDA
“0” “1”
DATA2 SDA
1 “0”
SCL SDA
START
“1” “0” “0” “1” “1” “0” 42
43
– Required pull-up resistors to pull the line to logic “1”
Requires pull-up resistors 2k 10 k 2k to 10 kΩ Open drain structure and bidirectional for SDA and/or SCL
SCL
SCL
10 pF Max
44
Max
Standard Mode Fast Mode Fast Mode Plus High Speed Mode Bit Rate 0 t 100 0 t 400 0 t 1000 0 t 1700 0 t 3400 Bit Rate ( kb/ s) 0 to 100 0 to 400 0 to 1000 0 to 1700 0 to 3400 Max Load ( pF) 40 400 560 400 100 Rise tim e 1000 300 120 160 80
Rise Time
( ns) 1000 300 120 160 80 Noise filter ( ns)
10 10 10
Rise Time
45
VCC
Master#2
VCC
Master#2
VDDMAX VOLMAX RMIN IOLMAX = 3mA IOLMAX = 6mA* IOLMAX = 30mA**
VCC Rpu
Master#2 Master#1
Slave Address#1 Slave Address#2 VCC Rpu
Master#2 Master#1
Slave Address#1 Slave Address#2
3.6 V 0.4 V 1.1 kΩ 533 Ω 106 Ω 5.5 V 0.4 V 1.7 kΩ 850 Ω 170 Ω Glossary RPU: Pull-up resistor
Address#1 Address#2 Address#1 Address#2
*With a buffer; **Fast mode Plus
PU
p RMIN: Minimum pull-up resistor RMAX: Maximum pull-up resistor VDDMAX: Maximum supply rail VOLMAX: Maximum output voltage low MODE Frequency tr CMAX RMAX
With a buffer; Fast-mode Plus
VOLMAX: Maximum output voltage low IOLMAX: Maximum sink current CMAX: Maximum load capacitance tr: Rise time Standard 100 kHz 1000 ns 400 pF 2.96 kΩ Fast Mode 400 kHz 300 ns 400 pF 885 Ω Fast Mode Plus 1000 kHz 120 ns 560 pF 252 Ω
46
47
max
1)
2)
3)
Rise Time
t1 t2 Time
48
49
50
V ∆
51
52
53
54
55
56
57
58
59
60
61
62
I/O `Expander` LED Blinker/ Dimmer DIP Switch AD/DA Converter Other Slave Color Mixing LED Driver Bus Buffer, Voltage Translator, Extender
VCC4 VCC5 VCC0
µC
I²C in hardware
emulation
µC
Bus C Master Selector Multiplexer& Switch
8
VCC2 VCC1
Functions with I2C I2C Bus Architecture Devices Custom I2C
EEPROM LCD Driver Real Time Clock / Calendar Temperature Sensor
µC
Controller
V
Custom I C hardware or software emulated Other hardware
I2C
Bridge
SPI UART
VCC3
63
65
OM# Description OM# Description OM6270 SPI/I2C to UART Bridge Demoboard (SC16IS750) OM6271 SPI to I2C Master Bridge Demoboard (SC18IS600) OM6272 UART to I2C Master Bridge Demoboard (SC18IM700) OM6273 SPI/I2C to Dual UART/IRDA/GPIO Demoboard (SC16IS752) OM6274 I2C to SPI Master Bridge Demoboard (SC18IS602) OM6275 I2C 2005-1 Demo Board (15 I2C devices w/USB control & GUI) OM6276 PCA9633 Demo Board (Four Color PWM LED Control with Microcontroller) OM6277 PCA9564 Eval Board (I2C Master) OM6278 I2C 2002-1A Eval Board (11 I2C devices w/printer port control & GUI) OM6279 LED Dimmer Demo Board OM6279 LED Dimmer Demo Board OM6281 PCA9698 Demo Board (Advanced 40-bit GPIO with PCA9530 LED blinker) OM6276 PCA9633 Demo Board (Four Color PWM LED Control) OM6285 I2C 2002-1A Eval Board (without/printer port control & GUI) ( p p ) OM6290 I2C –bus LCD driver evaluation board OM10088 PCF8562 LCD Segment Display
More information: www ics nxp com/support/tools/interface More information: www.ics.nxp.com/support/tools/interface
I2C/SPI slave to UART UART to I2C master SPI t I2C t I2C t SPI t I2C/SPI slave to UART UART to I2C master SPI to I2C master SC16IS7xx SC18IM700 SC18IS600 I2C to SPI master SC18IS602 Kit i l d Kits include Kit i l d Kits include
and NXP I2C devices
Kits include Key Benefit
NXP I2C devices
Kits include Key Benefit
RS485, and IrDA
Kits include Key Benefit
NXP SPI devices
Kits include Key Benefit y
Easy interface to UART host and various I2C and GPIO
y
Easy interface to SPI host and various I2C and GPIO
EEPROM and I2C LED
y
Easy interface to I2C/SPI host and IrDA, RS232/RS485, and GPIO devices. Selectable I2C or SPI-
y
Easy interface to I2C host and SPI and GPIO devices. Up to 4 SPI chip selects EEPROM and I2C LED Dimmer Dimmer bus interface
Up to 5Mbps!
OM6270 – SC16IS750 OM6273 – SC16IS752 OM6271 OM6272 Up to 4 SPI chip selects OM6274 OM6273 – SC16IS752
Fifteen different I²C devices on one board allows easy experimentation and training.
(PCA9531, PCA9536, PCA9538, PCA9540B, PCA9541, PCA9543A, PCA9551, PCF8563, PCF8574, PCF85116-3, SA56004, SE98)
Add Extra I/O Ports, Temperature Sensors, LED Drivers, Real-time Clock, I²C Bus S it hi Switching USB Connection to trial version (only devices on board and that fixed address is
www.ics.nxp.com/support/boards/i2c20051/ p pp Target Board & USB based GUI (400 kHz) #OM6275
Individual and Global PWM to set your perfect color and brightness or blink I²C interface for easy connection to Micro or Baseband IC Demo board with on board micro (LPC900) and FETs #OM6276 Stand alone demo Board #OM6282
– 25 mA per pin
– PCA9533, PCA9531 PCA9533, PCA9531 – On-board NXP MCU demonstrates capabilities – www.ics.nxp.com/support/boards/leddemo
Demonstrates a wide range of functions 1MHz Fast-mode Plus I2C-bus serial interface with 30mA drive 2.3 to 5.5V operation with 5.5V-tolerant I/O 40 configurable I/O pins that default to inputs at power-up Designed for live insertion in PICMG applications Designed for live insertion in PICMG applications Onboard PCA9530 LED dimmer/blinker for LED applications Low standby current Demo board #OM6281
Eleven different I²C devices on one board allows easy experimentation and training (LM75A, P82B96/PCA9600, PCA9501, PCA9515, PCA9543, PCA9550, PCA9551, PCA9554, PCA9555, PCA9561, PCF8582C-2) Add Extra I/O Ports, Temperature Sensors, LED Drivers, I²C Bus Switching Add Extra I/O Ports, Temperature Sensors, LED Drivers, I C Bus Switching I²C Bus adapter uses parallel printer port for connection to full version (all devices and addresses operational) of Graphics Interface for Windows PC/Laptop www.ics.nxp.com/support/boards/i2c20021/ Target Board plus parallel printer port control (100 kHz) & GUI #OM6278 Target Board plus parallel printer port control (100 kHz) & GUI #OM6278 Target Board only #OM6285
I²C
I C
COG i ti COG is an option
75
Product family Product family descriptions line cards cross reference data sheets data sheets Link to app notes models models user guides PLL design software datasheets
datasheets
76
77
78