当前位置:网站首页>IIC communication protocol for single chip microcomputer
IIC communication protocol for single chip microcomputer
2022-06-28 00:21:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
Concept
I2C(IIC,Inter-Integrated Circuit), Two wire serial bus , from PHILIPS The company developed for connecting microcontrollers and peripherals . It's made up of data lines SDA And the clock SCL The serial bus , Can send and receive data . stay CPU And accused IC Between 、IC And IC Two way transmission between , High speed IIC The bus can reach 400kbps above .
Hardware IIC: Hardware IIC Faster than simulation , And you can use DMA. Hardware IIC It will automatically match the communication sequence with the slave , Just configure the hardware IIC Some functions of . Software IIC: Simulation with software IIC Sequence diagram , So as to communicate with the slave
IIC Transmission characteristics
1. Half duplex : Half duplex communication allows signals to be transmitted in both directions , However, only one-way signal transmission is allowed on one channel at a certain time , Simplex communication with switchable direction
2. Serial synchronous communication : The data passes through a SDA Line transmission ,SCL Provide synchronization clock . The biggest feature of synchronous communication is the communication between both sides SCL The clock wires are connected together .
3. Master slave communication : Each communication cycle is initiated and ended by the master device , The slave only responds passively to the master , I can't do anything by myself . There are master and slave , Support multiple slaves .
4. Transport order : High in the former , Low in the back
5. Only SDA And SCL Two wires , However, a common ground wire is required between the master and the slave , Otherwise, how can the slave know whether the level sequence sent by the host is high or low !
6.SDA And SCL The bus must be connected to the pull-up resistor .
7, Transmission rate :I2C agreement v2.1 Three rates are specified (bps) -100K -400K -3.4M
The communication rate is based on the host SCL Speed to communicate ,SCL The communication speed on the shall be less than the maximum communication speed specified by the master and the slave
The communication process of one master and multiple slaves : The master device sends the first message in each communication cycle 8 Bit slave address , Actually 8 There is only 7 Bit is the slave device address (datasheet There's a device address ), also 1 Bit indicates whether to write or read from the master device ( Determined by the slave device ) To bus ( The master device is sent in the form of broadcast , As long as all the slave devices on the bus can actually receive this message ). Then each slave device on the bus can receive this address , After receiving the address, compare it with your own device address to see if it is equal . If it is equal, it means that the main equipment is talking to me this time , If you don't want to wait, this communication has nothing to do with me , Don't listen .
IIC sequential
Idle state :SDA And SCL The bus is in the high-level state
Start signal timing and end signal timing
Response signal timing
Every byte sent by the transmitter , Just before the clock pulse 9 Release the data line during , A reply signal is fed back by the receiver . The response signal is low (0) when , It is stipulated as effective answer (ACK Abbreviate answer bit ), Indicates that the receiver has successfully received the byte ; The response signal is high (1) when , Specified as non response bit (NACK), Generally, it means that the receiver failed to receive the byte .
The validity of the data
SCL During high level ,SDA The data of cannot be transformed ;SCL During low level ,SDA The data can only be transformed .
The read byte and write section sequence of the slave should be written according to the sequence diagram of the slave
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/133025.html Link to the original text :https://javaforall.cn
边栏推荐
- Deployment and test of crtmp live video server
- 积分体系和营销活动结合在一起有哪些玩法
- Chenyun pytorch learning notes_ Build RESNET with 50 lines of code
- NDSS 2022 received list
- 炼金术(9): 简约而不简单,永不停歇的测试 -- always_run
- 计数质数[枚举 -> 空间换时间]
- 【无标题】
- VirtualBox extended dynamic disk size pit
- MYSQL的下载与配置安装
- 数仓的字符截取三胞胎:substrb、substr、substring
猜你喜欢

Webserver flow chart -- understand the calling relationship between webserver modules

Matlb| optimal configuration of microgrid in distribution system based on complex network

吴恩达《机器学习》课程总结(11)_支持向量机

MATLB|基于复杂网络的配电系统微电网优化配置

flutter系列之:flutter中的变形金刚Transform

吴恩达《机器学习》课程总结(13)_聚类
![[idea] idea formatting code skills](/img/06/38079517e901bc48dc4ca0f8cc63fe.jpg)
[idea] idea formatting code skills

zotero文献管理工具安装使用

HCIP/HCIE Routing&Switching / Datacom备考宝典系列(十九)PKI知识点全面总结(公钥基础架构)
![[paper reading | deep reading] sdne:structural deep network embedding](/img/6a/b2edf326f6e7ded83deb77219654aa.png)
[paper reading | deep reading] sdne:structural deep network embedding
随机推荐
[digital ic/fpga] detect the position of the last matching sequence
Grab those duplicate genes
[AI application] detailed parameters of NVIDIA Tesla v100-pcie-32gb
安全省油環保 駱駝AGM啟停電池魅力十足
SCU|通过深度强化学习进行微型游泳机器人的步态切换和目标导航
Matlab基本函数 length函数
证券注册账户安全吗,会有风险吗?
ValidateRequest=”false” 是做什么的「建议收藏」
How to find Chinese documents corresponding to foreign documents?
[PCL self study: Segmentation3] PCL based point cloud segmentation: region growth segmentation
Alchemy (1): identify prototype, demo and MVP in project development
Using two stacks to implement queues [two first in first out is first in first out]
SQL reported an unusual error, which confused the new interns
本地可视化工具连接阿里云centOS服务器的redis
Although the TCGA database has 33 cancers
NDSS 2022 received list
内网IP和公网IP的区别及作用
線程池實現:信號量也可以理解成小等待隊列
什么是cookie,以及v-htm的安全性隐患
用两个栈实现队列[两次先进后出便是先进先出]