当前位置:网站首页>Learn the knowledge you need to know about the communication protocol I2C bus
Learn the knowledge you need to know about the communication protocol I2C bus
2022-07-01 08:00:00 【Huawei SCM Linbei】

I2C It was Philips in 80 A serial communication bus designed in the s , Using multiple groups of slave architectures , It is mainly used in the main chip and sensor of the system 、EEPROM And other peripheral equipment components .

I2C All devices on the bus have a master-slave relationship , Support multiple master devices online , It also supports arbitration and conflict detection .
I2C The maximum number of slaves supported by the bus is theoretically 127 individual , Each device has only one unique address , So that the main equipment can select the corresponding equipment for communication .
I2C The agreement only needs SCL and SDA Two lines .
SCL Is the abbreviation of serial clock line , The synchronization clock is generated by the master device , Responsible for transmitting clock signals .
SDA Is the abbreviation of serial data line , Used to transmit data signals .
Since both data lines are open drain output , Therefore, it is necessary to connect the pull-up resistor during communication . Usually in standard mode 100KBPS Use 10K The pull-up resistance of , In fast mode 400KBPS Use 2K The pull-up resistance of .I2C The bus also has high-speed mode 3.4MBPS And ultra fast mode 5MBPS You can choose .
When the main equipment and heavy equipment transmit data, they need to follow the corresponding data structure sequence .

The first part is the start signal , After the master sends the start condition signal , All slaves, even in sleep mode, will become active and wait to receive address bits .
The second part is address bits and read-write bits , Usually the address bits occupy seven bits of data , The master device needs to send the corresponding slave address , Match the slave attached to the bus .I2C It also supports ten bit addressing , The read / write bit has specified the transmission direction of the data .
The third part is the reply bit , Every time the host sends data, it will wait for the response signal from the slave device ACK.
The fourth part is the address of the internal register or the instruction data of the slave device .
The fifth part is the data block sent .
Finally, the stop bit .

Next, let's take a look at the timing table I2C agreement , The condition for starting the signal is SCL When it's high level ,SDA Jump from high level to low level , After that ,SDA Start with SCL Clock sending device address data ,8bit The data of contains seven bit device address data and degree reading data .
For read and write bits , If the master device sends to the slave device 0, If it is sent from the slave device to the master device in turn, it is 1, Then comes the reply bit , This data is in the 9 Clock signal cycle expression .
If the response signal is sent from the device ACK, that SDA Will be pulled down , If there is no answer signal , It means that the previous address data has not been received from the device ,SDA Will output to high level .

cause NACK There are many reasons , For example, the master device sends the wrong address data , Or the slave device is busy and cannot answer , The corresponding master device will choose to resend or stop according to the corresponding situation .
If the master device receives the reply signal , The address information of the internal register of the same device will be sent , For example, we want to read ADSL345 Acceleration sensor X Axis of the data ,ADSL The device address of is 0x53,X The internal register address of the axis data is 0x32, The corresponding master device needs to access after pairing the slave device address ADSL Internal address 0x32 In order to read X Axis data information .

After each transmission, a reply bit will follow , If the receiver successfully receives data , Is set to 0, Otherwise keep the logic 1, Then the eight bit data frame and the corresponding response are , The end is , The end condition is SCL When it's high level ,SD A It will jump from low level to high level .
Like to help collect some praise , Thank you for your support and encouragement !
Learn SCM , I'm serious about Warwick North , Children's shoes can come to me if they have any questions , Reply to Lin Bei in time to get very practical dry goods , I will be very satisfied if I can help you grow ! Okay , That's all for this issue , See you next time !
Hua Weilin North
边栏推荐
- 2022茶艺师(初级)操作证考试题库及模拟考试
- Scala language learning-07-constructor
- Minecraft 1.16.5 module development (51) tile entity
- How to get a SharePoint online site created using the office365 group template
- The triode is a great invention
- 【入门】取近似值
- LM08丨网格系列之网格反转(精)
- IMDB practice of emotion classification (simplernn, LSTM, Gru)
- 【入门】提取不重复的整数
- 【无标题】
猜你喜欢

How to make the two financial transactions faster

【入门】取近似值

軟鍵盤高度報錯

三极管是一项伟大的发明

Array: question brushing record

2022茶艺师(初级)操作证考试题库及模拟考试
![[batch DOS CMD summary] extension variables - delay variables CMD /v:on, CMD /v:off, SETLOCAL enabledelayedexpansion, disabledelayedexpansion](/img/ce/6c9e4f2c54710610e8b1f68d6d8088.png)
[batch DOS CMD summary] extension variables - delay variables CMD /v:on, CMD /v:off, SETLOCAL enabledelayedexpansion, disabledelayedexpansion

base64

Android screen adaptation (using constraintlayout), kotlin array sorting

Inftnews | from "avalanche" to Baidu "xirang", 16 major events of the meta universe in 30 years
随机推荐
Saving db4i depth camera pictures with MATLAB
SharePoint - how to quickly check whether SharePoint is standard or enterprise edition?
Long way to go with technology
Cmake I two ways to compile source files
奥迪AUDI EDI 项目中供应商需要了解哪些信息?
uni 热更新
H5 页面设置了字体的粗细样式,但是在华为手机里微信打开访问样式不生效?
2022 electrician (intermediate) recurrent training question bank and answers
SharePoint - modify web application authentication using PowerShell
base64
Introduction to kubernetes resource objects and common commands (II)
AArdio - 【问题】bass库回调时内存增长的问题
Vhost kick & call principle
Microsoft stream - how to modify video subtitles
Source code analysis of open source API gateway APIs IX
[batch dos-cmd command - summary and summary] - Common operators in the CMD window (<, < <, & <,>, > >, & >, & >, & &, ||, (),;, @)
Aardio - 阴影渐变文字
php laravel微信支付
Wang Yingqi, founder of ones, talks to fortune (Chinese version): is there any excellent software in China?
Gui Gui programming (XV) - use scale to control font size changes