当前位置:网站首页>Detailed explanation of serial port, com, UART, TTL, RS232 (485) differences

Detailed explanation of serial port, com, UART, TTL, RS232 (485) differences

2022-06-23 13:37:00 Little monster

introduction

During commissioning test , You will often encounter various interfaces 、 Adapter plate , I feel like I don't understand them , Knowing its form but not its meaning ; This is mostly true A serial port 、COM mouth 、UART mouth 、TTL、RS-232、RS-485 Make a detailed description .
A serial port 、UART mouth 、COM mouth 、USB Port refers to the form of physical interface ( Hardware );TTL、RS232、RS485 It refers to the level standard of ( Electrical signals ).

A serial port

There are two ways of serial communication : Serial communication and parallel communication .

  • serial communication : Every bit of data , On the same data line , Transmit bit by bit in sequence ;
  • Parallel communication : Each bit of data is transmitted on multiple data lines at the same time .

Serial port is a general term ,UART、TTL、RS232、RS485 They all follow similar communication timing protocols , So they are called serial ports .

UART

  • UART(Universal Asynchronous Receiver/Transmitter), namely Universal asynchronous transceiver ,UART It is the logic circuit of serial port transceiver . It can be used as a chip independently , It can also be embedded into other chips as a module ; Single chip microcomputer 、SOC、PC There are UART modular ;
  • The sender Of UART It will come from the control device ( Such as CPU) Of Parallel data is converted to serial data , Send it to the receiving end in serial mode UART, Then from The receiver Of UART take Serial data is converted to parallel data For normal processing of the receiving device .

COM

COM mouth ,(cluster communication port);COM mouth , The serial communication interface , Serial port for short .PC On board COM mouth , It's usually DB9 Nine pin interface of , Maximum speed 115200bps.

Baud rate 115200bps, That is, transmission per second 115200bit data , Since each frame of data contains the minimum number of start bits 1bit, Stop bit minimum 1bit, Check digit minimum 0bit, So serial port transmission 1 Bytes of data , At least 10bit, So the actual number of bytes transferred per second is 11520Byte, In actual use , It is often not up to this value .

USB

USB(Universal Serial Bus); namely Universal serial bus ; It's an external bus standard . Its communication timing and signal level are completely different from the serial port , So it has nothing to do with the serial port .USB It's a high-speed communication interface , Its communication mainly depends on D+,D- The differential line composed of two data lines is used for data transmission .USB There are two transmission rates , The first is full speed mode , The second is the low speed mode ;USB And it can support hot plug , also USB2.0 The transmission speed can reach 60MB/S,USB3.0 The transmission speed can reach 5Gb/s,USB3.1 The transmission speed can reach 10Gb/s, But in practice , Can not reach such a high speed .

UART And USB It is also an asynchronous transfer mode , The same four lines , Why? USB Than UART Will be so much faster ?

  • UART Three lines ,Tx、Tx、GND, Not four lines ( Except for relevant interconnection signal lines ).
  • USB yes D+、D-, The difference line is used , In this case, it can support a higher rate ( Because of its strong anti-interference ),usb3.0 Standards can be met 5Gbps( Theoretically ).
  • UART Standard ratio USB Much earlier , At that time, the technology could only support low-speed transmission .

TTL

TTL Bipolar transistor logic circuit , There are many on the market “USB turn TTL” modular , It's actually “USB turn TTL Level serial port ” modular . This signal 0 Corresponding 0V,1 Corresponding 3.3V perhaps 5V. And MCU 、SOC Of IO Level compatible . But it doesn't have to be TTL level , Because now most of the digital logic is CMOS It's made of technology , It's just used TTL That's what I'm saying . When we communicate with each other through serial port, the ones that come out directly from MCU are basically TTL level .
TTL level : full duplex ( Logic 1: 2.4V–5V Logic 0: 0V–0.5V)

The hardware block diagram is as follows ,TTL For two MCU Inter communication
 Insert picture description here
0’ and ‘1’ Express
 Insert picture description here

RS232

RS232 It's the electronics industry association (Electronic Industries Association,EIA) Asynchronous transmission standard interface , At the same time corresponding to the level standard and communication protocol ( sequential ), Its level standard :+3V~+15V Corresponding 0,-3V~-15V Corresponding 1.rs232 The logic level and TTL Not the same, but the agreement is the same .
RS-232 level : full duplex ( Logic 1:-15V–5V Logic 0:+3V–+15V)
The hardware block diagram is as follows ,TTL be used for MCU And PC Communication between computers
 Insert picture description here
‘0’ and ‘1’ Express
 Insert picture description here

RS485

RS485 Is a serial interface standard , in order to Long distance transmission adopts differential transmission , The transmission is Differential signal , The anti-jamming ability is better than RS232 Much better .

RS-485: Half duplex 、( Logic 1:+2V–+6V Logic 0: -6V—2V) The level here refers to AB The voltage difference between the two wires .
The hardware block diagram is as follows
 Insert picture description here
‘0’ and ‘1’ Express
 Insert picture description here

Common interface hardware diagram

COM Port is the serial communication port , Serial port for short . This is different from USB Of “ Universal serial bus ” And the hard disk “SATA”. Generally we see two physical standards .D type 9 Pin plug , and 4 There are two kinds of needle DuPont . This is common 4 Pin serial port , It's common on circuit boards , Often with DuPont pins . And sometimes there's a fifth needle ,3.3V The power side . Because it's reserved on the circuit board , There can be many kinds of agreements , It depends on the equipment .
 Insert picture description here
UART Yes 4 individual pin(VCC, GND, RX, TX), With TTL level , The low level is 0(0V), The high level is 1(3.3V Or more ).
 Insert picture description here
D type 9 Pin serial port ( In popular parlance ). You can see it behind the desktop . There are only two protocols for this interface :RS-232 and RS-485. Will not be TTL Level ( Except for special applications ).
 Insert picture description here
USB turn TTL The small board of serial port , It can be used USB Expand a serial port .
 Insert picture description here
USB turn RS-232 A serial port
 Insert picture description here

Reference material

UART USB TTL Related concepts and differences
A serial port 、COM mouth 、UART mouth , TTL、RS-232、RS-485 Detailed explanation

原网站

版权声明
本文为[Little monster]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206231256366080.html