当前位置:网站首页>Main features of IIC bus / communication process / read / write process
Main features of IIC bus / communication process / read / write process
2022-06-10 14:03:00 【Lixiaoyao】
Focus on 、 Official account of star standard , Straight to the highlights
source : Network material
Learning microcontroller must be some bus learning , Today, let's talk about IIC Bus , It is a kind of bus that we often use , This bus type was designed by Philips semiconductor in the early 1980s .
IIC What is a bus
IIC It is mainly used to connect the whole circuit (ICS),IIC It's a multidirectional control bus , In other words, multiple chips can be connected to the same bus structure , At the same time, each chip can be used as the control source of real-time data transmission . This way simplifies the signal transmission bus interface .IIC There are only two bidirectional signal lines , One is the data line SDA, One is the clock line SCL.
IIC The main features
It has multi-function , The module can be used as both master device and slave device .
IIC Main equipment function , It mainly generates clock signals ( Start signal and stop signal ).
IIC Slave device functions , programmable IIC Address detection , Stop bit detection .
Support different communication speeds , Standard speed ( The highest speed 100kHZ), Fast ( The highest 400kHZ).
IIC Communication process
In main mode ,IIC The interface starts data transmission and generates a clock signal . Serial data transmission always starts with a start condition and ends with a stop condition . Both start and stop conditions are generated and controlled by software in main mode .
When in slave mode ,IIC The interface can identify its own address (7 Bits or 10 position ) And the address broadcast on the data bus ( Like everyone has a different identity ID, Answer whatever you call ), At the same time, the software can control to turn on or prohibit the identification of broadcast call address .
The data and address are in accordance with 8 Bits per byte , High in the former . Following the starting condition 1 perhaps 2 One byte is the address (7 The bit mode is 1 Bytes ,10 The bit mode is 2 Bytes ). Addresses can only be sent in main mode . In one byte transmission 8 The ninth clock period after the first clock , After receiving from the mode, you must return a ACK To the transmitter , This is the only way to transmit data .

remind : stay IIC Idle ,SDA、SCL Keep it high .
Start signal : In the clock SCL Keep it high , then SDA The data line changes from high level to low level, indicating the start signal .
Stop signal : In the clock SCL Keep it high , then SDA The data line changes from low level to high level, indicating the stop signal .

Answer signal : The host has sent a message 8 After bit data , Will wait for the answer from the slave ; One ACK The signal ,SDA Will pull down .
Each byte must be guaranteed to be 8 Bit length . When data is transmitted , Send the highest bit first (MSB), Each transmitted byte must be followed by a reply bit ( That is, a frame has 9 position ). If the response signal from the slave is not received within a period of time , It is automatically considered that the slave has correctly received the data .

stay IIC When the bus transmits data , When the clock signal is high , The data on the data line must be stable , Only when the signal on the clock line is low , The high level or low level state of the data line is allowed to change , Otherwise, the data transmission fails .
IIC Communication process
IIC The process of reading and writing , From the perspective of the Lord .
With AT24C02 And 2440 Connect IIC signal communication ,AT24C02 For from ,2440 Mainly .
AT24C series EEPROM The fixed part of the chip is 1010,A2,A1,A0 After the pin is connected to the high and low level, it is determined 3 Bit code , formation 7 The bit code is the address code of the device .
Last R/W It means whether to read or write ,0 To write ,1 For readout .

IIC read
The single chip microcomputer sends the signal of the device first 7 Bit address code and write direction bit “0”(“ Fake writing ”), Release after sending SDA Line and in SCL The first... Is generated on the line 9 Clock signals . After confirming that the selected memory device is its own address , stay SDA A reply signal is generated on the line in response .
then , Send another byte of the first address of the memory area of the device to be read , After receiving the response , The MCU should repeat the start signal once and send out the device address and reading direction bit (“1”), After receiving the device response, the data bytes can be read out , Every byte read , MCU should reply to the response signal . When the last byte of data is read , The MCU should return with “ Non response ”( High level ), And send a termination signal to end the readout operation .
random block read

IIC write in
When the MCU performs write operation , First send the... Of the device 7 Bit address code and write direction bit ”0”( common 8 position , A byte ), Release after sending SDA Line and in SCL The first... Is generated on the line 9 Clock signals . After confirming that the selected memory device is its own address , stay SDA A reply signal is generated on the line as a response , After receiving the response, the single chip microcomputer can transmit data . When transmitting data , The MCU first sends a byte of the first address written into the memory , After receiving the response from the memory device , The single chip microcomputer sends data bytes one by one , But after each byte is sent, you have to wait for a reply .AT24C The serial on-chip address is automatically added after receiving each data byte address 1, On chip “ Number of bytes loaded at a time ” Within limits , Just enter the first address . The number of bytes loaded exceeds that of the chip “ Number of bytes loaded at a time ” when , The data address will “ Scroll up ”, The previous data will be overwritten .
Byte write

Page write

* This article is reproduced on the Internet , The copyright belongs to the original author , If there is infringement, please contact to delete
‧‧‧‧‧‧‧‧‧‧‧‧‧‧‧‧ END ‧‧‧‧‧‧‧‧‧‧‧‧‧‧‧
Pay attention to my WeChat official account , reply “ Add group ” Join the technical exchange group according to the rules . Click on “ Read the original ” See more sharing , Welcome to share 、 Collection 、 give the thumbs-up 、 Looking at .边栏推荐
- Review summary of final examination of software architecture principles, methods and practices, Second Edition
- 【离散数学期复习系列】六、树
- Use of 5.8G microwave radar module, working principle and introduction of 5.8G microwave radar module
- 618. How to prepare for the great promotion
- C multithreading learning note 4
- Flutter Listview, Column, Row学习个人总结2
- 2022大厂高频软件测试面试真题(附答案)
- Leetcode 2293. 极大极小游戏(可以.一次过)
- Markdown sets the font to red
- Leetcode 829. 连续整数求和
猜你喜欢

618. How to prepare for the great promotion

UE5如何將屏幕坐標轉為世界坐標和世界方向

2022年制冷与空调设备运行操作理论题库模拟考试平台操作

2022 examination question bank and online simulation examination for main principals of hazardous chemical business units

基于FPGA的VGA协议实现

一次主从表集成流程开发过程

What happened when the legendary login prompt failed to connect to the server? How to solve it?

初学者自己搭建博客的设计工具和技巧

【操作教程】如何正确使用海康demo工具配置通道上线?

大厂面试上午10:00面试,10:09就出来了 ,问的实在是太...
随机推荐
C#多线程学习笔记一
2022年危险化学品生产单位安全生产管理人员考试模拟100题及在线模拟考试
技术分享| 快对讲,全球对讲
如何定位游戏发热问题
How to build Haojing technology when the computing power network is brought into reality?
【专题介绍】圆桌论坛——AI与音视频技术的融合之路
【FAQ】运动健康服务REST API接口使用过程中常见问题和解决方法总结
Flutter Listview, Column, Row学习个人总结2
软件智能:aaas系统 度量衡及文法的形式规则
【技术分析】探讨大世界游戏的制作流程及技术——前期流程篇
【C语言】指针函数与函数指针、数组函数
Google Earth engine (GEE) -- batch download of DEM using MODIS leaf area index image mask
智慧校园安全通道及视频监控解决方案
Flutter 页面跳转 传参,TabBar学习总结5
2022 high frequency software test interview questions of large factories (with answers)
在启牛开户安全么
C#多线程学习笔记三
Leetcode 2293. 极大极小游戏(可以.一次过)
1
2022山东省安全员C证复训题库及在线模拟考试
