当前位置:网站首页>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
边栏推荐
- I stepped on a foundation pit today
- PTA tiantisai l1-079 tiantisai's kindness (20 points) detailed explanation
- AI 助力藝術設計抄襲檢索新突破!劉芳教授團隊論文被多媒體頂級會議ACM MM錄用
- WP collection plug-in free WordPress collection hang up plug-in
- 17. File i/o buffer
- Love and self-discipline and strive to live a core life
- Unity knapsack system (code to center and exchange items)
- Amélioration de l'efficacité de la requête 10 fois! 3 solutions d'optimisation pour résoudre le problème de pagination profonde MySQL
- LV1 Roche limit
- Latex tips slash \backslash
猜你喜欢
On Valentine's day, I code a programmer's exclusive Bing Dwen Dwen (including the source code for free)
Database concept and installation
Introduction to graphics: graphic painting (I)
The 37 year old programmer was laid off, and he didn't find a job for 120 days. He had no choice but to go to a small company. As a result, he was confused
false sharing
MySQL advanced (Advanced) SQL statement (I)
Iclr2022 | ontoprotein: protein pre training integrated with gene ontology knowledge
Crawler practice website image batch download
Yyds dry goods inventory override and virtual of classes in C
150 ppt! The most complete "fair perception machine learning and data mining" tutorial, Dr. AIST Toshihiro kamishima, Japan
随机推荐
60 year old people buy medical insurance and recommend a better product
Ai aide à la recherche de plagiat dans le design artistique! L'équipe du professeur Liu Fang a été embauchée par ACM mm, une conférence multimédia de haut niveau.
Safety tips - seat belt suddenly fails to pull? High speed police remind you how to use safety belts in a standardized way
A. Min Max Swap
中電資訊-信貸業務數字化轉型如何從星空到指尖?
Optimization theory: definition of convex function + generalized convex function
What are the conditions for the opening of Tiktok live broadcast preview?
3D game modeling is in full swing. Are you still confused about the future?
Johnson–Lindenstrauss Lemma
Fudan released its first review paper on the construction and application of multimodal knowledge atlas, comprehensively describing the existing mmkg technology system and progress
15. System limitations and options
The "two-way link" of pushing messages helps app quickly realize two-way communication capability
[Valentine's Day confession code] - Valentine's Day is approaching, and more than 10 romantic love effects are given to the one you love
Li Chuang EDA learning notes IX: layers
7 * 24-hour business without interruption! Practice of applying multiple live landing in rookie villages
Node solves cross domain problems
Network byte order
查詢效率提昇10倍!3種優化方案,幫你解决MySQL深分頁問題
13. Time conversion function
The first spring of the new year | a full set of property management application templates are presented, and Bi construction is "out of the box"