Communication protocol UART (transfer)

Source - Author @博乐Bar&: https://www.cnblogs.com/huanzxj/p/4522274.html

Readers are advised to read the original text to ensure complete information.

first part:

UART uses asynchronous, serial communication.
    Serial communication refers to the sequential transmission of data bit by bit using a transmission line. The characteristic is that the communication line is simple, the communication can be realized by using a simple cable, the cost is reduced, and it is suitable for the application of long-distance communication, but the transmission speed is slow.
    Asynchronous communication takes one character as the transmission unit. The time interval between two characters in communication is not fixed, but the time interval between two adjacent bits in the same character is fixed. 
    The data transfer rate is expressed in baud rate , which is the number of bits transferred per second. For example, the data transmission rate is 120 characters/second, and each character is 10 bits (1 start bit, 7 data bits, 1 check bit, 1 stop bit), then the baud rate of its transmission is 10 ×120 = 1200 characters/second = 1200 baud.
    The data communication format is as follows: the meaning of each bit is as follows: start bit : first send a logic "0" signal, indicating the beginning of the transmission character. Data bit : can be 5~8 bits logic "0" or "1". Such as ASCII code (7 bits), extended BCD code (8 bits). Little-endian transmission check bit : After adding this bit to the data bit, the number of "1" bits should be even (even parity) or odd (odd parity) Stop bit : it is the end mark of a character data. Can be 1-bit, 1.5-bit, 2-bit high level. Idle bit : in the logic "1" state, indicating that there is no data transmission on the current line.     Note: Asynchronous communication is transmitted by characters. After receiving the start signal, the receiving device can receive it correctly as long as it can maintain synchronization with the sending device within the transmission time of one character. The arrival of the start bit of the next character makes the synchronization recalibrated (relying on the detection of the start bit to realize the self-synchronization of the clock of the sender and the receiver)



    
    
    
    
    



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325460454&siteId=291194637