当前位置:网站首页>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
边栏推荐
- Caesar
- Kickback -- find the first palindrome character in a group of characters
- Download xshell and xftp
- 2022 electrician (intermediate) recurrent training question bank and answers
- [kv260] generate chip temperature curve with xadc
- 软键盘高度报错
- Access报表实现小计功能
- Android screen adaptation (using constraintlayout), kotlin array sorting
- Differential: definition of total differential, partial derivative, gradient
- Aardio - 自己构造的getIconHandle的方法
猜你喜欢
PWN attack and defense world int_ overflow
Latex table
PostgreSQL source code learning (26) -- windows vscode remote debugging PostgreSQL on Linux
IMDB practice of emotion classification (simplernn, LSTM, Gru)
【无标题】
Soft keyboard height error
【入门】取近似值
The triode is a great invention
2022 electrician (intermediate) recurrent training question bank and answers
[untitled]
随机推荐
Aardio - [problem] the problem of memory growth during the callback of bass Library
Insufficient executors to build thread pool
力扣每日一题-第31天-1502.判断能否形成等差数列
SQL number injection and character injection
LSTM of RNN
postgresql源码学习(26)—— Windows vscode远程调试Linux上的postgresql
Wang Yingqi, founder of ones, talks to fortune (Chinese version): is there any excellent software in China?
Basic number theory -- combinatorial number
Basic knowledge of MATLAB
5大组合拳,解决校园6大难题,护航教育信息化建设
Missing API interface actual development series (14): ID card real name authentication verification
2022茶艺师(初级)操作证考试题库及模拟考试
The H5 page has set the font thickness style, but the wechat access style in Huawei mobile phone doesn't take effect?
Chinese font Gan: zi2zi
2022 Guangdong Provincial Safety Officer a certificate third batch (main person in charge) special operation certificate examination question bank simulated examination platform operation
The database is locked. Is there a solution
【无标题】
Oracle create auto increment ID
Eigen matrix operation Library
2022 test questions and mock examinations for main principals of hazardous chemicals business units