Simply teach you how to understand synchronous and asynchronous communication

Synchronization means that you ask me to go to dinner, and I will go to dinner with you when I hear it;
if you don't hear it, you keep screaming until I tell you that you heard it, and then go to dinner together.
Asynchronous means that you call me and then go to eat by yourself. I may leave immediately after receiving the news, or I may wait until I get off work before going to eat.
So, if I invite you to dinner, use the synchronous method, if you want to invite me to dinner, use the asynchronous method, so you can save money.

Synchronization refers to a communication method in which the sender sends data and waits for the receiver to send back a response before sending the next data packet.
Asynchronous refers to the communication method in which after the sender sends data, it does not wait for the receiver to send back a response, and then sends the next data packet.

Synchronous is a blocking mode, and asynchronous is a non-blocking mode.

Wherein the SPI IICsynchronous communication UARTof asynchronous communication

In serial communication, data is transmitted bit by bit. In order to distinguish each byte, it is necessary for the sender and receiver to add some mark signal bits in the serial information stream of the transmitted data. The data is divided into two types: synchronous communication and asynchronous communication according to the different ways of the added mark signal bits. 1. "Asynchronous communication" is a very common method of communication (low efficiency) when asynchronous communication is sending characters, the sender can start sending characters at any time, so it must be added at the beginning and end of each character The mark, that is, the start bit and the stop bit are added so that the receiving end can receive each character correctly. The transmitted data is in bytes. A start bit is added before each byte, and a stop bit is added after each byte. Benefits: The advantage of asynchronous communication is that the communication equipment is simple and cheap, but the transmission efficiency is low. 2. The two parties of "synchronous communication" must first establish synchronization, that is, the clocks of both parties must be adjusted to the same frequency. The sender and receiver continuously send and receive a continuous stream of synchronization bits. One is to use network-wide synchronization, which uses a very accurate master clock to synchronize the clocks on all nodes of the entire network. One is to use quasi-synchronization, allowing small errors between the clocks of each node, and then adopting other measures to achieve synchronous transmission. Synchronous communication is to use multiple bytes (above 100 bytes) as the unit of the transmitted data, and add flags before and after it.

Guess you like

Origin blog.csdn.net/qq_41071754/article/details/114286666