当前位置:网站首页>[communication protocol] UART, I2C, SPI review
[communication protocol] UART, I2C, SPI review
2022-06-10 10:51:00 【Madaha 23】
Tips : When the article is finished , Directories can be generated automatically , How to generate it, please refer to the help document on the right
Catalog
One 、UART(Universal Asynchronous Receiver/Transmitter)
Preface : Communication basis
Before understanding the communication protocol , First of all, we need to understand the basics of communication
1. Parallel and serial
Parallel communication : Multi track data cable , Transfer data side by side , There's a lot of interference , Take up more resources
serial communication : A data cable , One bit One bit Send data , Little interference , Less resources
2. Simplex and duplex
Simplex : One way transmission of data , The transmission direction cannot be changed
Duplex :1. Half duplex : Both sides of communication can transmit data to each other , But it cannot be transmitted at the same time ( Do not send and receive at the same time )
2. full duplex : Both sides of communication can transmit data to each other at the same time ( Send and receive at the same time )
3. Baud rate (bit per second)
Serial communication rate , Company bps, That is... Transmitted per second bit digit
4. Synchronous and asynchronous
asynchronous communication : The clocks of communication parties are not synchronized , Generally, data is transmitted according to character frame (5-8 position ) Send data in bits , Low efficiency , For low-speed communication
Synchronous communication : Communication dual engine clock synchronization , According to the beat of the clock , Send in block bits , More efficient , The structure is more complicated , For high-speed communication
Tips : The following is the main body of this article , The following cases can be used for reference
One 、UART(Universal Asynchronous Receiver/Transmitter)
1. Interface mode : Half duplex / full duplex asynchronous communication , Single double three wire
2. Communication process : The bus is idle , At high level
Communication begins : Send data in character frame format , Start low and then start high
Character frame :1bit Start bit +5~8bit Data bits +1bit Parity bit ( not essential )+1bit or 2bit Stop bit
Start bit : Pull the bus down , On behalf of communication start
Stop bit : Pull the bus up , Represents the end of the communication
3. characteristic : The electrical interface is not unified , Poor anti-interference ability , Short communication distance
4.RS232 And RS485 standard
annotation :RS232 And RS485 It's just a rule UART Electrical interface standard of , It hasn't changed UART Sending and receiving timing
RS232:
Electrical protocol : Logic “1”:-5~-15V, Logic “0”:+5~+15V
Interface :DB-9( The actual time is three wire system :RXD,TXD,GND), full duplex
characteristic : Short transmission distance 15m, High level value is easy to burn out the circuit , Prone to common mode interference , Poor anti noise ability
RS485:
Electrical protocol : Logic “1”:2~ 6V, Logic “0”:-2~-6V , Differential line signal transmission ( That is, the voltage difference between the two lines 0/1)
Interface : Two wire system , Bus topology , Half duplex
characteristic : Allows the bus to connect multiple transceivers , Form similar I2C Device network
Anti noise , Long transmission distance 1500m
Two 、I2C
1. Interface mode : Half duplex , Sync , Two wire system (SDA,SCLK)
2. Communication process : The host sends the start signal ,
Host send 7bit Slave address +1bit Transmission relation bit of
The addressed slave sends ACK Reply back to the host
The transmitter sends a byte of data
The receiver accepts data , And send the ACK The reply
....
When the communication is complete , The host sends a stop signal
Idle :SDA,SCLK pull up
Start signal : The host initiates ,SCLK At high level ,SDA From high to low
Byte transfer : First high then low
ACK The reply : Every time a byte is transferred , The receiver sends to 1bit The answer signal of It's a frame 9bit
The data transfer :SCLK During low level , The transmitter is SDA send out 1bit data , period SDA Allowable change
SCLK During high level , The receiver is in SDA Read 1bit data , period SDA No change is allowed
Stop signal : The host initiates ,SCLK During high level ,SDA From low to high
3. characteristic : Low communication distance , Low transmission rate , Can mount multiple devices , Multi host bus , With anti-collision detection , Arbitration function
3、 ... and .SPI
1. Interface mode : Full duplex synchronization ,
At least four wires (SCLK,MOSI(Maste Ouput Slave Input),MISO,CS(Chip Slect))
2. Communication process :
1. Addressing : The host sends to the transmitter CS The signal
2. The data transfer : Byte transmission , First pass the high position, then the position
3. No response signal is required , Start the next byte transfer directly
4. Sending data : At the edge of the clock line , send data
5. Receive data : Next edge , The receiver reads data
summary
Tips : Here is a summary of the article :
for example : That's what we're going to talk about today , This article only briefly introduces pandas Use , and pandas Provides a large number of functions and methods that enable us to process data quickly and conveniently .
边栏推荐
- B站季报图解:营收51亿同比增30% 月均活跃用户近3亿
- Create swift color class
- Axure add drop-down menu linkage
- fragment实现底部导航栏不刷新切换
- 最大和的连续子数组
- PV操作每日一题-餐厅上菜问题
- 2022 underground coal mine electrical examination question bank and online simulation examination
- PV操作每日一题-售票问题
- VS Code支持配置远程同步了
- Is the online account opening channel reliable? Is it safe?
猜你喜欢

Yutai semiconductor rushes to the scientific innovation board: the annual revenue is 830million, and the actual controller is American

珠海高远电能科技有限公司30%股权转让,来自塔米狗分享

软件测试电商项目实战(实战视频B站已发布)

Leetcode 2000. 反转单词前缀

Northrop Grumman has passed the registration: the annual revenue is 600million, and Wu Jie, the actual controller, is an American

解析:稳定币不是「稳定的币」 其本质是一种产品

stm32 printf乱码

Leetcode 1991. Find the middle position of the array (brute force enumeration)
Common shell commands - 02 compression and decompression

Vs code supports configuring remote synchronization
随机推荐
51定时器初值计算
Working principle and application of single chip trigger or not gate
PV操作每日一题-独木桥问题(变式二)
Install the latest version of cocoapods tutorial
Development of NFT chain game gamefi system and construction of meta universe games
二进制、八进制、十进制、十六进制间互转(整数加小数)
Hardcore spoiler! With 11 topics and 14 celebrities, dragon dragon dragon community entered Intel meetup and announced the agenda!
股票获取最大利润
cocoslua在vs2013的调试方法
Fcpx plug-in: premiumvfx animation presets v1.0.1 Special Edition
Extending visual transformer to gigapixel images based on hierarchical self supervised learning
Mixin -- mixed
Phpstorm configuration database connection
指令集与应敏科技达成战略合作,国产原创物联网操作系统助力电力检测「智慧化」...
PV operation daily question - orange apple question (advanced version)
Drawing curve with MATLAB
Question bank and answers of 2022 metal and nonmetal mine hoist operation examination
stm32 printf乱码
塔米狗分享|房地产企业并购只增不减,那么上哪儿找这些项目呢?
二分查找有序数组中的特定值