Serial Port_ Serial Cable

An article to understand about Serial Port, COM、UART、USART、RS232、RS485、RS422、TTL

Embedded developers, whether looking at technical documents, or in the daily exchanges, often encountered serial port, COM, UART, USART, RS232, RS485, RS422, TTL, these terms, and sometimes can not tell the difference between them, this article, systematically analyze and sort out the difference between these terms, and later encountered will never be confused …

the name of the explanation

First of all, introduce the professional terminology and engineers to communicate with the corresponding colloquial and common name

Serial Port: serial communication interface, commonly known as serial port

COM: computer serial communication port (cluster communication port), commonly known as COM port, serial port

UART: Universal Asynchronous Receiver Transmitter, Universal Asynchronous Receiver Transmitter, commonly known as the serial port, which specifies the data transmission protocol standards

USART: Universal Synchronous/Asynchronous Receiver/Transmitter, Universal Synchronous Asynchronous Receiver Transmitter, commonly known as serial port, which specifies the data transmission protocol standard.

RS232: RS-232 serial communications hardware interface standards, including voltage levels, communication rates, etc.

RS485: RS-485 serial communications hardware interface standards, including voltage levels, communication rates, etc.

RS422: RS-422 serial communication hardware interface standards, including voltage levels, communication rates, etc.

TTL level: TTL interface, provides the level standard of 0 and 1 in digital circuit.

CMOS level: provides the level standard of 0 and 1 in digital circuits

In accordance with the usual practice, draw a table of comparison to help understand.

Computer SideMCU Controller
Serial Port Commonly known asCOM, COM port, Serial Port, USB virtual serial port, RS232UART、USART
Electrical InterfaceRS232、RS485、RS422TTL、CMOS

Electrical Characteristics

TTL, CMOS, RS232, and RS485 are all types of logic levels.

1. TTL level

   TTL is transistor transistor logic, this signal 0 corresponds to 0V, 1 corresponds to 3.3V or 5V, and is compatible with the IO levels of microcontrollers, MCUs, and SOCs. However, the actual is not necessarily TTL level, because now most of the digital logic is CMOS process to do, just along the TTL. We carry out serial communication from the microcontroller directly out of the basic are TTL, CMOS levels. On the market a lot of “USB to TTL” module, in fact, “USB to TTL level serial port” module.

TTL and CMOS logic levels according to the typical voltage can be divided into four categories: 5V Series, 3.3V Series, 2.5V Series and 1.8V Series.

Early devices were mostly TTL levels, such as the earlier 54 series and 74 series. Most of the devices nowadays use CMOS process.

Output level: high level Uoh >= 2.4v, low level Uol <= 0.4v

Input level: high level Uih >= 2.0v, low level Uil <= 0.8v

TTL voltage: generally 5V, now there are also LVTTL support 3.3V, 2.5V, 1.8V. for convenience, hereafter collectively referred to as TTL.

2. CMOS level

Output level: High level Uoh>= 0.9*VCC (≈ VCC), Uol <= 0.1*VCC (≈ GND)

Input level: high Uih >= 0.7*VCC Uil <= 0.3*VCC

CMOS voltage: generally 5V, now also have LVCMOS support 3.3v, 2.5v, 1.8v. For convenience, later collectively referred to as CMOS. 3.

3. TTL and CMOS difference

(1) TTL circuit is a current-controlled device, high loss when stabilizing, high heat, can not do a higher degree of integration of the chip. CMOS circuits are voltage controlled devices with low power consumption.

(2) TTL circuit is fast, the transmission delay time is short (5-10ns), but the power consumption is large, COMS circuit is slow, the transmission delay time is long (25-50ns), but the power consumption is low, that is to say, the delay of the TTL circuit is smaller than the CMOS circuit.COMS circuit itself is related to the power consumption and the frequency of the pulse of the input signal, the higher the frequency, the chip set of the more heat, which is a normal phenomenon. This is a normal phenomenon.

(3) TTL and CMOS devices have different voltage types, 5V, 3.3V, 2.5V, 1.8V.

(4) The current drive capability is different, TTL generally provides 25mA drive capability, while CMOS generally in the 10mA or so; the size of the required current input is also different, generally TTL needs 2.5mA or so, CMOS almost no need for current input; a lot of devices are compatible with TTL and CMOS, the data sheet will be illustrated. If you do not consider the speed and performance, the general device can be interchanged.

4.RS232:

Due to the early appearance of the RS232 interface standard, the following characteristics and deficiencies exist.

(1) Interface level characteristics: interface signal level is high, it is easy to damage the interface circuit of the chip. the voltage of any signal line on the RS232 interface is in a negative logic relationship. That is: logic “1” for -3 ~ -15V; logic “0”: +3 ~ +15V. incompatible with TTL levels, need a level conversion circuit to connect to the TTL circuit.

(2) Low transmission rate. In asynchronous transmission, the baud rate is 50, 75, 100, 150, 300, 600, 1200, 2400, 4800, 9600, 19200

(3) The interface utilizes a signal line and a signal return string to form a common form of grounded transmission. This standard grounded transmission is susceptible to common-mode interference and therefore has weak noise immunity.

(4) Transmission distance is limited. The maximum transmission distance is 50 feet. It can only reach approximately 15 meters.

(5) Full duplex. There are separate transceiver data lines, so it can communicate in full duplex.

(6) Point-to-point communication only.

5. RS485:

For RS232 shortcomings, RS485 has made the following improvements:

(1) interface level characteristics: RS-485 electrical characteristics: logic “1” by the voltage difference between the two lines +2V ~ +6V, logic “0” by the voltage difference between the two lines -6V ~ -2V. The interface signal level is lower than RS-232, which is not easy to damage the interface circuit chip. The level is compatible with TTL level, easy to connect with TTL circuit.

(2) Maximum data transfer rate: 10Mbps

(3) RS-485 interface adopts the combination of balanced driver and differential receiver, which has the ability of anti-resonance solid-mode interference, i.e. good anti-noise performance.

(4) The maximum transmission distance of the RS-485 interface is 4000 feet, practically up to 3000 meters.

(5) The RS-232 interface allows only one transceiver to be connected to the bus, i.e., single station capability. In contrast, the RS-485 interface allows only up to 128 transceivers to be connected to the bus, i.e., multi-station capability. Users can quickly establish a network of devices using a single RS-485 interface.

(6) Half-duplex only

6. RS422

RS-422 in order to solve the shortcomings of RS485 can only half-duplex, and extend a set of data lines, so that it has a full-duplex communication capability.

(1). Interface level characteristics: the same as RS485.

(2). Maximum data transfer rate: the same as RS485.

(3). Anti-noise performance: same as RS485.

(4). Communication distance: same as RS485.

(5). Data transmission protocol for multi-point communication. Unlike RS-485, RS-422 does not allow multiple transmitters but only multiple receivers.

(6). RS422 adopts 4-wire, full-duplex communication capability, the hardware composition of RS-422 is equivalent to two groups of RS-485, i.e., two half-duplex RS-485 constitutes a full-duplex RS-422.

7.USART/UART

USART, Universal Synchronous Asynchronous Transceiver, is a full-duplex universal synchronous/asynchronous serial transceiver module. In the embedded field, it also has a more colloquial name, i.e. “serial port”.

UART, which is based on USART cut off the synchronous communication function, UART is more commonly used. USART rely on the host’s clock to synchronize the data transmission baud rate, while UART is the two sides of the communication baud rate negotiated in advance.

USART / UART only specifies the protocol layer communication standards, and does not specify what level characteristics, the physical layer hardware can be flexible according to the communication object, for example, can be TTL, CMOS, RS232, RS485, RS422. protocol layer communication standards, specifies the format of the data transmission, the start bit + data frame + parity bit + stop bit.

Summarize the comparison

(1) TTL, CMOS, RS232, RS485, RS422 level standard parameters:

Logic LevelSupply VoltageInput high logic-1 Input low logic-0Input high logic-1Input low logic-0
TTL5.0V2.0V~ 5.0V0V~0.8V2.4V~5.0V0V~0.5V
LVTTL3.3V2.0V~ 3.3V0V~ 0.8V2.4V~3.3V0V~0.4V
LVTTL2.5V1.7V~ 2.5V0V~0.7V2.0V~ 2.5V0V~0.2V
LVTTL1.8V1.17V~1.8V0V~0.63V1.35V~1.8V0V~0.45V
CMOS5.0V3.5V~ 5.0V0V~1.5V4.45V~5.0V0V~0.5V
LVCMOS3.3V2.0V~ 3.3V0V~0.8V2.4V~ 3.3V0V~0.4V
LVCMOS2.5V1.7V~ 2.5V0V~0.7V2.0V~ 2.5V0V~0.4V
LVCOMS1.8V1.17V~1.8V0V~0.63V1.35V~1.8V0V~0.45V
RS2323.3V/5V-15V~ -3V3V~ 15V-15V~ -3V3V~ 15V
RS4853.3V/5V+2V ~ +6V-6V~-2V+2V~+6V-6V~-2V
RS4223.3V/5V+2V~+6V-6V~-2V+2V~+6V-6V~-2V
LVDS3.3V/5V1.252V~ 3.3V/5V0V~1.249V1.252V~3.3V/5V0V~1.249V

As you can see from the above: with a 5V supply voltage, CMOS circuits can directly drive TTL, while TTL circuits cannot directly drive CMOS circuits. Other levels can not be directly driven, so the need for level conversion between the 2. TTL, RS232, RS485 explained later also have the problem of level matching, also need level conversion. This is why, we are in the serial communication hardware, often need level conversion chip.

(2). Comparison of functions, performance characteristics

electrical levelRateEMIDistanceNetworkFull duplex, half duplex
RS232HighLowLowNearOne to OneFull duplex
RS485LowHighHighFarMany -to -manyhalf duplex
RS422LowHighHighFarOne -to -manyFull duplex

UART, USART, TTL, RS232, RS485, RS422 serial port have different level characteristics, then, these devices interconnect the first condition of normal communication is that the level must be matched, otherwise, the light is not functioning properly, and the heavier is to burn the board, burn the chip.

(1). UART + UART

Because microcontroller, MCU, microcontroller UART port levels are TTL levels, if the TTL level is the same, then, UART + UART interconnect does not require level conversion. If a UART TTL 3.3V, a UART TTL 1.8V, then also need to be converted to the same level through the level conversion chip and then interconnect.

(2) UART + computer USB serial port

(3) UART+RS232

(4) UART+RS485

Leave a Comment

Your email address will not be published. Required fields are marked *