What Is...I2C?

Microchip Technology, Inc.
11 Sept 201906:24

Summary

TLDRThe video script introduces I2C (Inter-Integrated Circuit), a serial communication protocol developed by Philips in 1982 for connecting peripheral devices to microcontrollers. It's known for its simplicity, requiring only two pins, and is cost-effective due to fewer logic gates needed. I2C is widely used in various applications like IoT, consumer electronics, and aerospace. The protocol operates synchronously with a master-slave model, allowing bi-directional communication. It offers different speed modes, with standard, fast, and fast mode plus being the most common. The script also explains the I2C communication process, including start and stop conditions, slave addressing, read/write bits, and data transfer.

Takeaways

  • 🌐 I2C (Inter-Integrated Circuit) is a communication protocol for connecting peripheral devices to a microcontroller.
  • 📅 I2C was developed by Philips (now NXP) in 1982 for serial communication between integrated circuits.
  • 🔗 I2C is widely used in various applications including IoT, consumer electronics, industrial equipment, automotive, and aerospace.
  • 💰 I2C devices are cost-effective due to fewer logic gates required and only needing 2 pins for implementation.
  • 🔄 I2C operates on a master-slave architecture with the master device providing the clock signal for communication.
  • 🚦 I2C is a synchronous, bi-directional, and serial bus protocol.
  • 🔢 I2C supports five speed categories ranging from 100 kHz to 5 MHz, with standard mode, fast mode, and fast mode plus being the most common.
  • 🔗 Each device on an I2C bus must have a unique slave address, which is specified in the device datasheet.
  • 🔵 The I2C protocol involves a start condition, slave address, read/write bit, acknowledge bits, data bytes, and a stop condition.
  • ⏲️ I2C transactions are initiated with a start condition where the master pulls the SDA line low while SCL is high.
  • 🔔 Acknowledge bits in I2C act as a 'handshake' between the master and slave, ensuring correct data transmission.

Q & A

  • What does I2C stand for?

    -I2C stands for Inter-Integrated Circuit, which is also referred to as I2C or IC.

  • Who created the I2C protocol?

    -The I2C protocol was created by Philips, now NXP, back in 1982.

  • What was the original purpose of the I2C protocol?

    -The original purpose of I2C was to provide a simple serial bus for various TTL integrated circuits or ICs.

  • Why is I2C still widely used today?

    -I2C is widely used today because it is cost-effective to manufacture due to fewer logic gates needed and only requires two pins to implement.

  • What are the advantages of using I2C over other protocols?

    -I2C offers advantages such as lower costs, simplicity, and the fact that it only requires two pins, making it suitable for a wide range of applications.

  • What is the nature of communication in I2C?

    -I2C is a synchronous protocol with master-slave communication, where the master provides the clock and initiates communication with the slave.

  • What are the different speed categories in I2C?

    -The speed categories in I2C are Standard Mode (100 kHz), Fast Mode (400 kHz), Fast Mode Plus (1 MHz), High Speed Mode (3.4 MHz), and Ultra Fast Mode (5 MHz).

  • What is the most common I2C speed category?

    -The most common I2C speed categories are Standard Mode, Fast Mode, and Fast Mode Plus due to their ease of implementation.

  • What are the two bus lines in I2C?

    -The two bus lines in I2C are Serial Clock (SCL) and Serial Data (SDA).

  • How does the I2C protocol ensure proper communication?

    -I2C protocol ensures proper communication by using pull-up resistors (R1 and R2), which work on the premise that SCL and SDA bus lines are open drain or open collector.

  • What is the purpose of the start and stop conditions in I2C?

    -The start condition initiates an I2C transaction by driving the SDA line low while SCL is high, and the stop condition terminates the transaction by releasing the SDA line while SCL is high, returning the bus to an idle state.

  • What does the R/W bit signify in I2C communication?

    -The R/W bit, following the slave address, indicates whether the master wants to read (1) from the slave or write (0) to the slave.

  • What is the function of the acknowledge bits in I2C?

    -Acknowledge bits in I2C serve as a 'handshake' between the master and the slave, indicating whether data was received correctly (ACK) or not acknowledged (NACK).

Outlines

00:00

🔍 Introduction to I²C

The script introduces the I²C (Inter-Integrated Circuit) protocol, also known as I²C, which was created by Philips (now NXP) in 1982. It was designed as a simple serial bus for TTL integrated circuits and has become a standard for serial communication between a microcontroller and peripheral devices. I²C is favored for its low cost due to fewer logic gates required and only needing two pins for implementation. It's extensively used in various applications including IoT, consumer electronics, industrial, automotive, and aerospace. The protocol operates synchronously with a master-slave architecture where the master controls the clock and data rate. It's bi-directional, allowing data transfer in both directions serially over two lines: Serial Clock (SCL) and Serial Data (SDA). The script also details the five speed categories ranging from 100 kHz to 5 MHz, with standard mode, fast mode, and fast mode plus being the most commonly implemented due to their simplicity. An example is given with a microcontroller and three slaves, illustrating the use of pull-up resistors necessary for open-drain/open-collector communication. The script concludes with a brief on I²C waveforms, explaining start and stop conditions, slave addressing, read/write bits, and acknowledge bits.

05:01

📈 Understanding I²C Data Transfer

This paragraph delves into the specifics of data transfer over the I²C bus. It explains that data bytes contain information such as register settings, memory contents, or sensor readings. The number of data bytes is determined by the operation being performed. The structure of the slave device and the word or register address that the master wants to access are also part of the data transaction. The paragraph concludes with a discussion on the stop condition, which is necessary to terminate I²C transactions and return the bus to an idle state, ready for the next transaction. Links to related videos, such as an explanation of SPI (Serial Peripheral Interface), are provided to further the viewer's understanding of serial communication protocols.

Mindmap

Keywords

💡I2C

I2C stands for Inter-Integrated Circuit, also known as I-squared-C. It is a synchronous serial bus protocol used for communication between a microcontroller and peripheral devices. In the video, I2C is described as a simple and robust protocol created by Philips (now NXP) in 1982. It's central to the video's theme as it's the main protocol being discussed and its simplicity and robustness are highlighted as reasons for its widespread use.

💡Serial Bus

A serial bus is a type of data bus that transmits data serially, one bit at a time, usually in a linear sequence. In the context of the video, I2C is a serial bus that facilitates communication between a master device (like a microcontroller) and one or more slave devices. The video explains that I2C is a simple serial bus that uses only two pins, making it cost-effective and widely used in various applications.

💡Microcontroller

A microcontroller is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. In the video, the microcontroller acts as the bus master in an I2C communication setup, initiating communication with peripheral devices. It illustrates the role of microcontrollers in managing I2C transactions and their prevalence in devices that use I2C.

💡Slave Device

In the I2C protocol, a slave device is any device that responds to the commands from the master device. The video mentions that I2C is a master-slave communication protocol, with the master providing the clock and the slave devices responding to commands. Examples of slave devices given in the script include a serial EEPROM, a digital temperature sensor, and a fan controller.

💡Bi-directional Bus

A bi-directional bus allows data to be transferred in both directions between devices. The video explains that I2C is a bi-directional bus, meaning the master can both write to and read from the slave devices. This feature is crucial for various applications where data exchange in both directions is necessary.

💡Pull-up Resistors

Pull-up resistors are used to ensure that the bus lines (SCL and SDA in I2C) are in a known state when no device is driving them. In the video, it is mentioned that pull-up resistors R1 and R2 are required for I2C devices to communicate properly. They help to create a logic high state when the bus is idle, which is essential for the correct functioning of the I2C protocol.

💡Start Condition

The start condition in I2C signaling is a specific sequence where the SDA line is pulled low while the SCL line remains high. The video describes how all I2C transactions are initiated with a start condition, which must begin with the bus in an idle state. This condition signifies the beginning of a data transfer between the master and slave.

💡Stop Condition

A stop condition in I2C signaling is a sequence that indicates the end of data transmission. The video explains that a stop condition is defined as the master releasing the SDA line while the SCL signal level is high. It signifies the end of an I2C transaction and returns the bus to an idle state, making it ready for the next transaction.

💡Speed Categories

I2C has different speed categories that define the maximum data transfer rate. The video lists these categories as standard mode, fast mode, fast mode plus, high-speed mode, and ultra-fast mode, ranging from 100 kHz to 5 MHz. These categories are important as they determine the performance of I2C in various applications, with standard mode, fast mode, and fast mode plus being the most commonly implemented due to their ease of use.

💡Acknowledge Bits

Acknowledge bits in I2C are signals sent by the receiver to indicate that data has been received correctly. The video describes acknowledge bits as a 'handshake' between the master and the slave, occurring on every ninth clock cycle. An ACK from the slave confirms receipt of a bit, while an NACK indicates a problem, which is crucial for error checking in data transmission.

💡Data Byte

A data byte in I2C is a unit of data being transferred between the master and slave devices. The video explains that the data byte contains the actual information being communicated, such as register settings, memory contents, or sensor readings. The number of data bytes exchanged can vary depending on the operation being performed, which is determined by the master and the structure of the accessed slave device.

Highlights

I2C was created by Philips (now NXP) in 1982 for TTL integrated circuits.

I2C is a simple serial bus for communication between a peripheral device and a microcontroller.

I2C is now used in almost all microcontrollers sold by any supplier.

I2C devices are cost-effective due to lower logic gate requirements.

I2C requires only 2 pins, making it low cost to implement.

I2C is the most common serial bus used in various applications including IoT, consumer electronics, industrial equipment, automotive, and aerospace.

I2C is a synchronous protocol with a master-slave architecture.

The master device provides the clock which sets the data transfer rate.

I2C is bi-directional, allowing data transfer in both directions.

I2C operates on two bus lines: serial clock (SCL) and serial data (SDA).

There are five speed categories in I2C: standard mode, fast mode, fast mode plus, high speed mode, and ultra-fast mode.

The most common I2C speed categories are standard mode, fast mode, and fast mode plus due to their ease of implementation.

I2C uses pull-up resistors for proper communication, working on an open-drain/open-collector principle.

An I2C transaction starts with a start condition, defined by the master driving the SDA line low while SCL is high.

Each device on the I2C bus requires a unique slave address.

The read/write bit follows the slave address and determines if the master wants to read from or write to the slave.

Acknowledge bits are like a handshake between the master and slave, occurring on every ninth clock cycle.

Data bytes contain the information transferred between the master and slave.

I2C transactions end with a stop condition, which releases the SDA line while SCL is high.

Transcripts

play00:01

[Music]

play00:08

hello and welcome again to microchips

play00:11

memory technology series so what is I

play00:14

squared C well I squared C is an acronym

play00:16

for inter integrated circuit it can also

play00:20

be referred to as a IC or i2c I squared

play00:24

C was created by Phillips now nxp back

play00:27

in 1982 as a simple serial bus for their

play00:30

various TTL integrated circuits or ICS

play00:32

it provides a simple and robust serial

play00:35

communication between a peripheral

play00:37

device and a microcontroller today about

play00:40

40 years later almost all

play00:41

microcontrollers sold by any supplier

play00:43

include at least one connection option

play00:45

for I squared C communication why

play00:48

because I squared C devices compared to

play00:51

other protocols are slightly lower costs

play00:53

to manufacture due to the lower number

play00:55

of logic gates needed to build the I

play00:57

squared C interface and it only takes 2

play01:00

pins to implement which also translates

play01:02

to low cost and this lower cost has made

play01:05

I squared C the most common and widely

play01:06

used serial bus across most applications

play01:09

including IOT consumer electronics

play01:12

industrial equipment automotive and

play01:14

aerospace here are some details about

play01:17

the I squared C protocol I squared C is

play01:19

a synchronous protocol that allows a

play01:21

master to initiate communication with a

play01:23

slave device I squared C protocol is a

play01:26

master slave communication with the

play01:28

master providing the clock which

play01:30

effectively becomes the data transfer

play01:32

rate or clock frequency it is a

play01:35

bi-directional bus meaning the master

play01:37

can write to the slave and read from the

play01:39

slave and it is a serial bus which means

play01:41

data is clock or shifted bit by bit and

play01:44

there are two bus lines serial clock SCL

play01:47

and serial data s da ni squared C there

play01:52

are five speed categories including

play01:54

standard mode fast mode fast mode plus

play01:57

high speed mode in ultra fast mode these

play02:00

speed categories range from 100

play02:02

kilohertz to 5 megahertz 100 kilohertz

play02:05

up to 1 mega Hertz are very similar

play02:07

while 3.4 mega Hertz requires some

play02:10

special considerations

play02:12

and five megahertz being uni-directional

play02:14

requires yet even more special attention

play02:17

but by far the most common I squared C

play02:19

speed categories are standard mode fast

play02:22

mode and fast mode plus because these

play02:25

three are the easiest to implement

play02:26

here's an example of four devices

play02:29

connected to the same I squared C bus

play02:31

the microcontroller is the bus master

play02:33

and the three slaves are a serial East

play02:36

squared a digital temp sensor and a fan

play02:38

controller r1 and r2 are the pull-up

play02:41

resistors which are required for I

play02:43

squared C devices to communicate

play02:44

properly this is because I squared C

play02:47

protocol works on the premise that the

play02:49

SCL and SDA bus lines are open drain or

play02:52

open collector the transmitting device

play02:54

just lets go of the I squared C bus to

play02:56

create a logic one and pulls or drives

play02:58

the line the ground to create a logic

play03:00

zero next let's look at an I squared C

play03:03

waveform at first the waveform might

play03:06

look a bit complex but if we break the

play03:08

waveform down into sections then it will

play03:10

become much easier to decode all I

play03:13

squared C transactions are initiated

play03:15

with a start condition the start

play03:18

condition is defined as the master

play03:19

driving the SDA line low to a logic 0

play03:22

while SEL remains high and note that it

play03:25

must be initiated with the I squared C

play03:26

bus in an idle State meaning the SDA

play03:29

NSEL lines are both high or a logic one

play03:32

the slave address immediately follows

play03:35

the start condition and it could be

play03:37

seven bits or ten bits long

play03:38

although the seven bit slave address is

play03:40

by far the most common the slave address

play03:43

will be specified in the device

play03:45

datasheet and it is important to note

play03:47

that each device on the I squared C bus

play03:49

needs a unique slave address next is the

play03:53

read and write or r / w bit it

play03:55

immediately follows the slave address

play03:57

and together with the slave address form

play03:59

the control byte this bit informs the

play04:02

slave if the master wants to read or

play04:03

write a 1 indicates the master wants to

play04:06

read from the slave and a 0 means the

play04:09

master will write to the slave this is

play04:11

easy to remember by just looking at the

play04:13

r / w symbol as there's a bar over the w

play04:16

meaning lo is its active state the next

play04:20

section is the acknowledge bits and we

play04:22

can think of the acknowledge bit like a

play04:23

handshake between the master and the

play04:25

slave

play04:26

they occur on every ninth clock cycle

play04:28

regardless of where we're at in the I

play04:30

squared C protocol the device receiving

play04:32

the data is responsible for generating

play04:34

this acknowledgment and since I squared

play04:36

C is bi-directional this can either be

play04:38

the master or the slave a zero means the

play04:42

receiving device acknowledges or acts

play04:44

and a one indicates the receiving device

play04:47

did not acknowledge or next coming from

play04:50

the slave an ACK indicates the bite was

play04:52

received correctly coming from the

play04:54

master an act requests that the slave

play04:57

transmit the next byte in the operation

play04:59

while an ACK signals the end of the

play05:01

operation next is the data byte and the

play05:04

data byte or data bytes contain the

play05:06

information being transferred between

play05:08

the master and the slave the data

play05:10

contained in this byte can become

play05:12

ambit's

play05:12

register settings memory contents sensor

play05:16

readings or any number of things and the

play05:18

number of data bytes transmitted it's

play05:20

determined by the operation being

play05:21

performed in the structure of the slave

play05:23

device being accessed common examples

play05:26

are the word address or register address

play05:28

that the master wants to access the data

play05:31

to be written in a write operation or

play05:33

the data from the slave requested in a

play05:35

read operation and finally the last

play05:38

section of the I squared C protocol is a

play05:40

stop condition all I squared C

play05:43

transactions should be terminated with a

play05:45

stop condition the stop condition is

play05:48

defined as the master releasing the sta

play05:50

line while the SEL signal level is high

play05:52

after a stop condition the I squared C

play05:55

bus will remain in an idle state and

play05:57

won't be free for the next I Square t

play05:58

transaction well that is I squared C

play06:02

here are some links to some other videos

play06:05

in our memory technology series since

play06:08

you just watch what is I squared C you

play06:10

may enjoy our what is SPI video since it

play06:13

builds off I squared C to explain the

play06:15

differences between I squared C and the

play06:16

faster SPI serial bus thanks for

play06:19

watching

Rate This

5.0 / 5 (0 votes)

Etiquetas Relacionadas
I2C ProtocolMicrocontrollersSerial CommunicationPhillips NXPElectronicsBus InterfaceLow CostIndustrial IoTConsumer TechAutomotive
¿Necesitas un resumen en inglés?