
Communication issues, like traffic problems, can vary in speed, congestion, and interruptions. If we compare serial communication to traffic, UART can be likened to a station, and a frame of data is akin to a car. Cars on the road must obey traffic rules. In the city, the speed limit is generally 30 or 40, while on highways it can reach 120. The route and speed limits depend on the specified protocol. Common serial protocols include RS-232, RS-422, and RS-485. What are the subtle differences between them? Let’s explore.
1. What is UART?
UART stands for Universal Asynchronous Receiver/Transmitter, commonly referred to as UART. It is a type of asynchronous transceiver, a key module for asynchronous communication between devices. UART handles the serial-to-parallel and parallel-to-serial conversion between the data bus and the serial port and specifies the frame format. As long as both communicating parties use the same frame format and baud rate, communication can be completed with just two signal lines (Rx and Tx) without sharing a clock signal, which is why it is also called asynchronous serial communication.
By adding a suitable level converter, such as SP3232E or SP3485, UART can also be used for RS-232 and RS-485 communication or connected to a computer port. UART is widely used in applications such as mobile phones, industrial control, and PCs.
UART uses asynchronous, serial communication. Serial communication refers to the sequential transmission of data one bit at a time over a single transmission line. Its characteristics include simple communication lines, reduced costs by utilizing simple cables, and suitability for long-distance communication, albeit at slower transmission speeds. Asynchronous communication uses one character as the transmission unit, with the time interval between two characters being variable, while the time intervals between adjacent bits within the same character are fixed. The data transmission rate is expressed in baud rate, which indicates the number of binary bits transmitted per second. For example, if the data transmission rate is 120 characters per second, and each character consists of 10 bits (1 start bit, 7 data bits, 1 parity bit, 1 stop bit), the baud rate would be 10 × 120 = 1200 characters per second = 1200 baud. The data communication format is illustrated below:
The meanings of each bit are as follows: Start Bit: A logical ‘0’ signal is sent first, indicating the beginning of the transmitted character. Data Bits: Can be 5 to 8 bits of logical ‘0’ or ‘1’, such as ASCII code (7 bits) or extended BCD code (8 bits). Low-end transmission. Parity Bit: This bit ensures that the number of ‘1’s in the data bits is even (even parity) or odd (odd parity). Stop Bit: This indicates the end of a character data. It can be 1, 1.5, or 2 bits of high level. Idle Bit: Remains in a logical ‘1’ state, indicating no data transmission on the current line. Note: Asynchronous communication is character-based; the receiving device can correctly receive data as long as it maintains synchronization with the sending device within the duration of one character’s transmission after receiving the start signal. The arrival of the next character’s start bit recalibrates synchronization (achieved by detecting the start bit for self-synchronization of the clocks of the sending and receiving parties).
2. RS-232 Standard
RS-232 is a serial physical interface standard established by the Electronic Industry Association (EIA) in the United States. RS is an abbreviation for