当前位置:网站首页>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
边栏推荐
- Sword finger offer 20 String representing numeric value
- 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.
- Problems and solutions of several concurrent scenarios of redis
- Zblog collection plug-in does not need authorization to stay away from the cracked version of zblog
- 7 * 24-hour business without interruption! Practice of applying multiple live landing in rookie villages
- false sharing
- I stepped on a foundation pit today
- Fudan released its first review paper on the construction and application of multimodal knowledge atlas, comprehensively describing the existing mmkg technology system and progress
- Unity knapsack system (code to center and exchange items)
- Yyds dry goods inventory override and virtual of classes in C
猜你喜欢
3D game modeling is in full swing. Are you still confused about the future?
C learning notes: C foundation - Language & characteristics interpretation
FRP intranet penetration
MySQL advanced SQL statement (1)
Dans la recherche de l'intelligence humaine ai, Meta a misé sur l'apprentissage auto - supervisé
Take you to master the formatter of visual studio code
Record a problem that soft deletion fails due to warehouse level error
Iclr2022 | ontoprotein: protein pre training integrated with gene ontology knowledge
Fudan released its first review paper on the construction and application of multimodal knowledge atlas, comprehensively describing the existing mmkg technology system and progress
Tsinghua University product: penalty gradient norm improves generalization of deep learning model
随机推荐
Node solves cross domain problems
Yyds dry goods inventory override and virtual of classes in C
Introduction to graphics: graphic painting (I)
15. System limitations and options
Solve the problem that the tabbar navigation at the bottom of vantui does not correspond to the page (window.loading.hash)
A. ABC
查詢效率提昇10倍!3種優化方案,幫你解决MySQL深分頁問題
Format character%* s
長文綜述:大腦中的熵、自由能、對稱性和動力學
How to subcontract uniapp and applet, detailed steps (illustration) # yyds dry goods inventory #
Dare to climb here, you're not far from prison, reptile reverse actual combat case
[untitled] the relationship between the metauniverse and digital collections
Lichuang EDA learning notes 14: PCB board canvas settings
[development team follows] API specification
Global and Chinese market of handheld melanoma scanners 2022-2028: Research Report on technology, participants, trends, market size and share
ZABBIX API batch delete a template of the host
Keepalived set the master not to recapture the VIP after fault recovery (it is invalid to solve nopreempt)
Global and Chinese market of thin film deposition systems 2022-2028: Research Report on technology, participants, trends, market size and share
2006 translation
Safety tips - seat belt suddenly fails to pull? High speed police remind you how to use safety belts in a standardized way