Let's talk about the communication protocol I2C subsystem

Let's talk about the communication protocol I2C subsystem

I2C Transfer

Definition of timing

To explore the I2C protocol in depth, you must have a deep understanding of the definitions of various times (F/S-mode)

Identifier

definition

tf

Signal fall time

tr

Signal rise time

tLOW

Signal low level time

tHIGH

Signal high level time

tHD;DAT

Data retention time

tSU;DAT

Data creation time

TSP

The input filter must suppress the glitch pulse width

tBUF

Idle time for start and stop conditions

tHD;STA

Hold time for repeated start condition

tSU;STA

Setup time for repeated start condition

tSU;STO

Stop condition setup time

Sr restarts, S starts, and P stops.

Note: When SCL is high, SDA is high, which is 1, and low, which is 0. During SCL low, SDA changes data.

Note: The start condition is easy to understand. Repeating the start condition means there is no STOP, then a START, and then sending another slave device ID to access other slave devices.

Defining Terms

1. Data Validity

During the SCL high level period, SDA must be stable, so in general, the SCL high level width is small and the SDA high level width is large, which is also the case when viewed with an oscilloscope.

2. Start condition and stop condition

Start condition: When SCL is high, SDA changes from high to low.

Stop condition: When SCL is high, SDA changes from low to high.

Generally, each time a byte (8 bits) is transmitted, it will restart. SDA changes data during the low level period of SCL, and cannot change data during the high level period of SCL, otherwise it will be considered as a start and stop condition.

  • The transfer length must be one byte (8 bits)
  • Unlimited bytes per transfer
  • Data must be transmitted starting with the MSB, that is, the highest bit is transmitted first.
  • The slave can hold the clock line SCL low, forcing the master to enter a wait state.

3.ACK or NACK

After each byte is transmitted, the slave device must respond with ACK or NACK.

ACK: After transmitting 8 bits, at the ninth bit, SCL is high. If SDA is low, it means ACK is responded.

NACK: After transmitting 8 bits, at the ninth bit, SCL is high. If SDA is high, it means a NACK response.

4.write data

5. read data

6. Composite Format

7.I2C Transfer Regulation

  • Start with START condition
  • End with STOP condition
  • The first byte transmitted is 7-bit slave address + 1-bit read/write bit
  • Each device on the bus will compare the 7-bit address after the STRAT signal with its own address to see if it matches.
  • Each byte (8 bits) will be followed by ACK or NACK
  • After a START signal or repeated START signal, the slave must reset its bus logic
  • A START followed by a STOP signal is an illegal format.
  • The host master can generate a repeated START signal + another device address instead of a STOP signal to directly start accessing another device.

8.10-bit addressing

The analysis is as follows:

A9-A0 indicates 10 bits address

9. Oscilloscope waveform

10. Supplement

I2C does not support the slave device to initiate an interrupt on the SCL and SDA buses to notify the master device to read data. Slave devices with interrupt requirements need to connect an additional interrupt line to notify the master that the data is ready and let the master initiate the data read operation.

<<:  Will the laser in a broken optical fiber harm us?

>>:  2022 Network Open Source Technology Ecosystem Summit (Online) concluded successfully

Recommend

Why IoT needs LPWAN

LPWAN deployment for IoT devices aims to provide ...

DNS communication protocol based on privacy protection technology

The Domain Name System (DNS) is an Internet basic...

TripodCloud: US CN2 GIA line VPS with large hard disk $40.99/half year onwards

TripodCloud (Yunding Network) is a relatively low...

Illustration | A cross-domain problem confused me

[[439558]] This article is reprinted from the WeC...

The secrets of the mobile data war: "Unlimited" is conditional

As the deadline for the cancellation of roaming c...

E-commerce past | Farewell to public domain traffic

[[420018]] It is not difficult to see that 2020 i...

What is the difference between artificial intelligence and machine learning?

【51CTO.com Quick Translation】 Artificial intellig...

Industry hot spots of data center in 2018

For many people, 2017 has been an intense and bus...

Easy-to-understand illustrations of online interview knowledge - Part 1

Regarding network knowledge, I mainly talk about ...

Report: Global 5G mobile data traffic is growing explosively

Mobile network operators promise their users that...

How fast is 5G? How does the 5G network work?

[[257849]] 4G LTE has been providing ultra-fast d...

How do 5G base stations control mobile phones under NSA?

The 5G network architecture is divided into SA an...