当前位置:网站首页>SCM learning notes 9 -- common communication methods (based on Baiwen STM32F103 series tutorials)
SCM learning notes 9 -- common communication methods (based on Baiwen STM32F103 series tutorials)
2022-07-24 01:21:00 【Mountains】
Chapter nine Common communication methods
Communication is data transmission , Send or receive data between different modules . Therefore, the communication mode can also be considered as the data transmission mode . The common communication methods are as follows .
One 、 Serial and parallel communication
The simple difference between serial and parallel is whether the data transmission line is one or more .
1、 serial communication
Serial communication is to use one line for data transmission , All the data is strung together , Series connection in similar circuit .

One clock transmits one data , For the picture above 0x5ABC Come on , want 16 It takes a clock to send .
The advantage of serial communication is that less resources are used , Only one thread is needed , The cost is low . The disadvantage is that the transmission speed is slow , A clock can only pass one bit, But with the development of Technology , Now the speed of serial communication is faster and faster , It can meet most scenarios , So in the actual development , We prefer serial communication . However, data loss may also occur in serial communication .
2、 Parallel communication
Parallel communication uses multiple lines for data transmission , A clock transmits multiple data through multiple lines , Parallel connection in similar circuits .

Above, 8 Parallel communication of lines , It can be transmitted at one time 8 individual bit, This is also transmission 0x5ABC, It only takes two clock cycles .
The advantage of parallel communication is high transmission speed . The disadvantage is high cost , Unable to use long-distance scenes , And too many parallel lines will cause signal interference .
Two 、 Synchronous and asynchronous communication
The difference between synchronization and asynchrony depends on whether the working frequency of the sender and the receiver are consistent , Consistency is synchronization , Inconsistency is asynchronous . The simple understanding is whether the two sides are Under the same clock standard Data transfer , That is to see whether the clock lines are sometimes connected between the two sides .
1、 Synchronous communication
Both parties are under the control of the same clock signal , Receive and send data , A clock , The sender sends , The receiver receives , Their working state is consistent with each other .
The data frame composition of synchronous communication is generally : Synchronous signal + Some data . At the front is a synchronization signal , After the receiving end receives the data and analyzes the synchronization signal , It is considered that the data behind are actually transmitted . Theoretically, the number of bits of several data in a data frame of synchronous communication is unlimited .
In synchronous communication , There can be no interval between data , Because both sides work under the same clock , It's on this side , It must be sent by the other side . After the synchronization signal , Think that all data are actual data , So when there is no information to transmit , The synchronization signal should be filled with the characters above .
2、 asynchronous communication
Asynchronous communication when sending characters , The time interval between transmitted characters can be arbitrary . Because every frame of data has start and stop bits , The data bits between them are the actual data . So the way for the receiver to judge whether the data is a complete frame of data is to analyze the start bit and stop bit in this pile of data .
The sender can start sending characters at any time , The receiving end must be ready for receiving at all times .
Because every data frame transmitted will have a start bit and a stop bit , The actual data generally only accounts for 5-8 position , This leads to the low transmission efficiency of asynchronous communication .
3、 ... and 、 Simplex 、 Half duplex 、 Full duplex communication
The difference between them is that at the same time , Whether the device can send and receive data .
1、 Simplex
The device can only send data or receive data . That is to say, he There is only one function , Or you can only send data , Or you can only receive data . It's like a radio , He can only receive external data and cannot send data to the outside .
2、 Half duplex
Half duplex indicates that the device has two functions , It can send data , And can accept data , But in At the same time He can only use one of these functions , Cannot receive data when sending data , You cannot send data when receiving data . Like a walkie talkie , Listening and speaking are separate , You can only choose to speak or listen to others at the same time .
3、 full duplex
Full duplex can be compared with the above two at the first glance , It's the best . In full duplex communication mode , Equipment in At the same time , It can send and receive data . It's like a cell phone , While speaking, you can also hear others' voices .
Four 、 Communication rate
For synchronous communication , The communication rate depends on the clock signal , The faster the clock signal , The faster the communication speed .
For asynchronous communication , Both sending and receiving sides should have the same communication rate , Otherwise, the data will be garbled . such as 1S Inside , The sender sent 100 Data , But the receiver 1S Can only receive 50 Data , It's lost 50 Data .
There are usually two units to describe the communication rate , Bit rate and baud rate .
The bit rate is transmitted by the subsystem in unit time bit The number of , use Rb Express , The unit is bit/s, Abbreviation for bps
Baud rate is the number of symbols transmitted by the system in unit time , use RB Express , The unit is porter Bd.
A symbol is the level value on a data line , For example, there are only 0V and 5.5V Two kinds of state , Then the symbol has 2 States ; Yes 0V,3.3V,5V Three states , There are symbols 3 States .
The relationship between bit rate and baud rate : x i 2 x_i^2 xi2Rb = RB * log2(N);N Is the state of the symbol .
5、 ... and 、 Common communication protocols

In actual development , According to the product requirements, from the performance 、 cost 、 Stability and other factors .
边栏推荐
- OSPF(第六天笔记)
- Determination of host byte order
- HCIP第十二天笔记
- HCIP第七天笔记
- Measurement and acquisition of permanent magnet motor parameters (inductance, resistance, pole number, flux linkage constant)
- Hcip, OSPF comprehensive experiment
- Openresty template real-time rendering Lua resty template
- EasyExcel导出案例(只有你想不到)
- Description of TCP packet sticking problem code
- HCIP第十一天笔记
猜你喜欢

Sublime text 3 汉化+添加常用插件

小熊派简介和环境搭建

沃尔沃xc90的安全性如何?提供5座和7座可选

爬虫请求库的使用2

HCIP中OSPF详解

HCIP第三天笔记

1000 okaleido tiger launched binance NFT, triggering a rush to buy

2022 global developer salary exposure: China ranks 19th, with an average annual salary of $23790

New infrastructure of enterprise data in the era of digital transformation | love Analysis Report

Kotlin基础从入门到进阶系列讲解(基础篇)关键字:suspend
随机推荐
HCIP第三天笔记
Measurement and acquisition of permanent magnet motor parameters (inductance, resistance, pole number, flux linkage constant)
OSPF(第四天笔记)
Interview question: what are the differences between ArrayList and LinkedList
1000 okaleido tiger launched binance NFT, triggering a rush to buy
HCIP,OSPF综合实验
Openresty template real-time rendering Lua resty template
High voltage technology test questions and answers
HCIP第一天笔记
数字化转型时代的企业数据新基建 | 爱分析报告
Explanation and induction of polymer physics terms
Three usages of synchronized keywords in vernacular
Socket basic knowledge and various usage scenarios
Easyexcel export case (only you can't think of it)
Description of TCP packet sticking problem code
C language database: an online dictionary based on TCP multi process, with detailed steps illustrated. Welcome to watch it
SQL CASE 多条件用法
SCM learning notes 1 -- data download and environment construction (based on Baiwen STM32F103 series tutorials)
Use and understanding of string functions (2)
Preprocessing instruction define, do you really understand?