[Switch] port, COM port, UART port, TTL, RS-232, RS-485 Detailed difference

Always will encounter a variety of interfaces, a variety of converter board debugging, Sidongfeidong feel very uncomfortable!

First, serial, UART port, COM port, USB port means in the form of a physical interface (hardware). And TTL, RS-232, RS-485 refers to a standard level (electric signal).

Serial: Serial is a general term, UART, TTL, RS232, RS485 follow a similar sequence of communication protocols, are known as the serial port.

UART interface: UART (Universal Asynchronous Receiver / Transmitter), UART is a logic circuit serial port transceiver, which portion may be independently into chips, can be used as the module is embedded into the other chip, the microcontroller, SOC, PC inside, there will UART module .

COM port: a desktop computer or some especially D-SUB shape (a connector structure, VGA interface connector is D-SUB) on a serial communication port of the electronic device, the application logic of the RS232 serial communication timing and level.

USB ports: Universal Serial Bus, and serial entirely different concept. Although it is a serial communicate, but communication timing and signal level USB and serial ports are completely different, and therefore nothing to do with the serial port. USB is a high-speed communication interface for connecting various PC peripherals, U disk, keyboard and mouse, a removable disk, of course, also includes a module "USB serial" of. (USB to serial module, USB interface is UART module)

TTL, RS232, RS485 level is a logical representation

TTL: TTL bipolar transistor logic circuit means, on the market many "USB to TTL" module is actually a "USB to TTL level serial" module. Such a signal 0 corresponds to 0V, 1 corresponding to 3.3V or 5V. , SOC's IO level compatible with the microcontroller. But not necessarily the actual TTL level, because most digital logic CMOS processes are done, just follow the TTL argument. When we serial communication from the microcontroller is basically out of direct TTL level.  

TTL level: Full Duplex (logical 1: 2.4V - 5V logic 0: 0V - 0.5V)

1, a block diagram of the hardware follows, TTL MCU for communication between two

2, '0' and '1' represents

 

RS232: is the Electronic Industries Association (Electronic Industries Association, EIA) standard interface developed by asynchronous transmission, while the corresponding level and standard communication protocols (sequence), which level criteria: + 3V ~ + 15V corresponding to 0, -3V ~ - 1 corresponds to 15V. rs232 TTL logic level is different but the same protocol.

RS-232 level: Full Duplex (logical 1: -15V - 5V logic 0: + 3V - + 15V)

1, a block diagram of the hardware follows, TTL used for communication between the PC and the MCU

 2, '0' and '1' represents

RS485: RS485 serial port is a standard mode for long-distance transmission differential transmission, the transmission is a differential signal, a lot stronger than anti-interference ability RS232. Two wire differential pressure - (2 ~ 6) V represents 0, two wire differential pressure + (2 ~ 6) V 1 represents

RS-485: half-duplex, (logic 1: + 2V - + 6V logic 0: -6V --- 2V) level here refers to the voltage difference between the two lines AB.

1, a block diagram of the hardware is as follows

 2, '0' and '1' represents

--------------------------------------------------------------------------------------------------------------------------------------------------------

That COM port serial communication port, serial port for short. Here it is different from USB "Universal Serial Bus" and hard "SATA".

Generally we are seeing is two physical standards. 9-pin D-type connector, pin 4, and the first two DuPont.

It is common to 4-pin serial port, a common circuit board, often also with upper pins DuPont. When there is a fifth needles, 3.3V power supply.

Since a reservation on the circuit board, there are many possible protocols, it depends on the specific device.

 

 

 Embedded inside said serial port, generally refers to the UART port, but we often do not know the difference between it and the COM port, and the relationship between RS232, TTL and so on, in fact UART, COM refers to the physical interface in the form of (hardware), and TTL, RS-232 refers to a standard level (electric signal).

 The UART 4 ​​pin (VCC, GND, RX, TX), TTL level is used, the low level 0 (0V), the high level is 1 (3.3V or more).

下面这个就是D型9针串口(通俗说法)。在台式电脑后边都可以看到。

记住,这种接口的协议只有两种:RS-232和RS-485。不会是TTL电平的(除非特殊应用)。

9针串口的定义可以参考这里:http://wenku.baidu.com/view/5c170c6925c52cc58bd6be6e.html

我们一般只接出RXD TXD两针,外加GND。  

下图是个USB转TTL串口的小板,可以用USB扩展出一个串口。芯片为PL2303HX。

网上经常混淆各种串口,但是这个确实是可以给STC单片机下载程序的。

 这是另一种,CP2102芯片的,也是USB转TTL串口。据说比PL2303的好,实际使用中没感觉出来。这个小板就多了+3.3V电源端,以适应不同的目标电路。

 下图为USB转RS-232串口:

转:https://blog.csdn.net/wb790238030/article/details/83502823

Guess you like

Origin www.cnblogs.com/sggggr/p/12200743.html