当前位置:网站首页>The difference between MCU serial communication and parallel communication and the understanding of UART
The difference between MCU serial communication and parallel communication and the understanding of UART
2022-07-04 02:52:00 【Huawei SCM Linbei】
If we need to start from a MCU Send a piece of data to another MCU, We can choose two ways of communication , Serial communication or parallel communication .
If the data we want to send is digital 198 Convert to binary , Namely 11000110, If serial communication protocol is used , We only need a data line to send data in bit order , The communication distance can range from a few meters to thousands of meters , Parallel communication protocols can also be used , We need eight data lines to send data directly and in parallel .
Because parallel data cannot carry clock information , To ensure consistent signals , Additional clock signal lines are required , And the communication speed is fast , But the corresponding line cost is also higher , The anti-interference ability is also worse , Therefore, the communication distance is very limited .
When we use MCU When communicating , Serial protocols often have simple peripherals 、 Low cost and long communication distance , So it's more popular .
Our commonly used serial protocols are Sbus,PPM,USB,RS232,Morse Code,JTAG,UART,I2C,CAN,SPI,MIDI etc. , Even Morse code is serial communication . Depending on the clock used , We can divide serial communication into synchronous communication and asynchronous communication .
That we use a lot I2C and SPI It's all synchronous communication , Both sides of synchronous communication need to use a clock with the same frequency , The receiver needs to be ready to receive data at all times , Only need assistance bit The string is used as the start and stop identification , So the transmission efficiency is high , You can also communicate one to many .
The typical representative of asynchronous communication is serial port UART. Both sides of asynchronous communication use their own clocks , The receiving method realizes information synchronization by identifying the start bit and end bit in the data packet , Therefore, the data efficiency is low , Only one-to-one communication .
Let's first look at our commonly used serial communication , Three wires are needed , Send data line TX, Receiving data line RX And reference GND You can communicate .
Before communication, both parties should know the baud rate of communication 、 Data length 、 Start bit and stop bit , For example, we need to send 198 This number is converted into binary to 11000110, We can load the data to be sent into data bits , When communicating , We also need a start bit and an end bit .
We usually use high signal to indicate that communication stops , Because in this way, there will be no communication error when the signal is interfered . When the receiver detects that the signal changes from high to low , It means to start communication , You can start reading data .
We also need to configure a parameter , It's baud rate , Our commonly used baud rate is 9600 Porter per second , It means sending every second 9600 A symbol , The length of each symbol is one divided by 9600 be equal to 104 Microsecond .
But in practical applications , When we detect that the data start bit starts reading data , Usually postponed 52 Read data in microseconds , Because the initial data may be unstable , After that, what the receiver has to do is every 104 Collect data every microsecond , Until the eight digit data is read, the data stop bit is read , Even if we use other baud rates to send different data , We also need to read the start bit and stop bit in the same way .
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
边栏推荐
- Contest3145 - the 37th game of 2021 freshman individual training match_ F: Smallest ball
- Global and Chinese market of contour projectors 2022-2028: Research Report on technology, participants, trends, market size and share
- [untitled] the relationship between the metauniverse and digital collections
- Keepalived set the master not to recapture the VIP after fault recovery (it is invalid to solve nopreempt)
- [Yugong series] February 2022 attack and defense world advanced question misc-83 (QR easy)
- 16. System and process information
- Database concept and installation
- Push technology practice | master these two tuning skills to speed up tidb performance a thousand times!
- 60 year old people buy medical insurance and recommend a better product
- A. ABC
猜你喜欢
Valentine's Day - 9 jigsaw puzzles with deep love in wechat circle of friends
在尋求人類智能AI的過程中,Meta將賭注押向了自監督學習
Www 2022 | taxoenrich: self supervised taxonomy complemented by Structural Semantics
Li Chuang EDA learning notes 13: electrical network for drawing schematic diagram
On Valentine's day, I code a programmer's exclusive Bing Dwen Dwen (including the source code for free)
I stepped on a foundation pit today
Remember another interview trip to Ali, which ends on three sides
LV1 previous life archives
Advanced learning of MySQL -- Application -- index
Chapter 3.4: starrocks data import - Flink connector and CDC second level data synchronization
随机推荐
The boss said: whoever wants to use double to define the amount of goods, just pack up and go
[UE4] parse JSON string
Hunan University | robust Multi-Agent Reinforcement Learning in noisy environment
Node solves cross domain problems
Basé sur... Netcore Development blog Project Starblog - (14) Implementation of theme switching function
I stepped on a foundation pit today
Zblog collection plug-in does not need authorization to stay away from the cracked version of zblog
Key knowledge of embedded driver
Latex tips slash \backslash
AI 助力藝術設計抄襲檢索新突破!劉芳教授團隊論文被多媒體頂級會議ACM MM錄用
Create real-time video chat in unity3d
ZABBIX API batch delete a template of the host
Hospital network planning and design document based on GLBP protocol + application form + task statement + opening report + interim examination + literature review + PPT + weekly progress + network to
Contest3145 - the 37th game of 2021 freshman individual training match_ J: Eat radish
Dare to climb here, you're not far from prison, reptile reverse actual combat case
Chain ide -- the infrastructure of the metauniverse
On Valentine's day, I code a programmer's exclusive Bing Dwen Dwen (including the source code for free)
17. File i/o buffer
Network byte order
false sharing