当前位置:网站首页>串口、COM、UART、TTL、RS232(485)区别详解
串口、COM、UART、TTL、RS232(485)区别详解
2022-06-23 12:57:00 【小小怪༻】
引言
调试测试时,往往会遇到各式各样的接口、转接板,感觉对它们似懂非懂,知其形而不解其意;这里主要是对串口、COM口、UART口、TTL、RS-232、RS-485作详细说明。
串口、UART口、COM口、USB口是指的物理接口形式(硬件);TTL、RS232、RS485是指的电平标准(电信号)。
串口
串口的通信方式有两种:串行通信和并行通信。
- 串行通信:数据的每一位,在相同的一根数据线上,按照顺序逐位传输;
- 并行通信:数据的每一位同时在多根数据线上传输。
串口是一个泛称,UART、TTL、RS232、RS485都遵循类似的通信时序协议,因此都被称为串口。
UART
- UART(Universal Asynchronous Receiver/Transmitter),即通用异步收发器,UART是串口收发的逻辑电路。可以独立作为芯片,也可以作为模块嵌入到其他芯片中;单片机、SOC、PC都有UART模块;
- 发送端的UART将来自控制设备(如CPU)的并行数据转换为串行数据,以串行方式将其发送到接收端的UART,然后由接收端的UART将串行数据转换为并行数据以用于接收设备的正常处理。
COM
COM口,(cluster communication port);COM口,即串行通信接口,简称串口。PC机上的COM口,一般为DB9的九针接口,最大速率115200bps。
波特率115200bps,即每秒传输115200bit数据,由于每一帧数据包含了起始位最少1bit,停止位最少1bit,校验位最少0bit,所以串口传输1字节数据,至少耗费10bit,所以实际每秒传输字节数为11520Byte,在现实使用过程中,又往往达不到这个值。
USB
USB(Universal Serial Bus);即通用串行总线;是一个外部总线标准。其通信时序和信号电平都和串口完全不同,因此和串口没有任何关系。USB是高速的通信接口,其通信主要靠D+,D-两条数据线构成的差分线来进行数据传输。USB有二种传输速率,第一种是全速模式,第二种则是低速模式;USB并且可以支持热插拔,并且USB2.0传输速度可达60MB/S,USB3.0的传输速度可达5Gb/s,USB3.1传输速度可达10Gb/s,但是实际使用时,达不到这么高的速度。
UART与USB同样是异步传输模式,同样是四根线,为啥USB比UART的速度会快那么多呢?
- UART是三根线,Tx、Tx、GND,不是四根线(相关联络信号线除外)。
- USB是D+、D-,用的是差分线,这样的话可以支持的速率更高(因为抗干扰性强),usb3.0标准可以达到5Gbps(理论上)。
- UART标准比USB早很多,当时的技术只能支持低速传输。
TTL
TTL指双极型三极管逻辑电路,市面上很多“USB转TTL”模块,实际上是“USB转TTL电平的串口”模块。这种信号0对应0V,1对应3.3V或者5V。与单片机、SOC的IO电平兼容。不过实际也不一定是TTL电平,因为现在大部分数字逻辑都是CMOS工艺做的,只是沿用了TTL的说法。我们进行串口通信的时候从单片机直接出来的基本是都是 TTL 电平。
TTL电平:全双工(逻辑1: 2.4V–5V 逻辑0: 0V–0.5V)
硬件框图如下,TTL用于两个MCU间通信
0’和‘1’表示
RS232
RS232是电子工业协会(Electronic Industries Association,EIA) 制定的异步传输标准接口,同时对应着电平标准和通信协议(时序),其电平标准:+3V~+15V对应0,-3V~-15V对应1。rs232 的逻辑电平和TTL 不一样但是协议一样。
RS-232电平:全双工(逻辑1:-15V–5V 逻辑0:+3V–+15V)
硬件框图如下,TTL用于MCU与PC机之间通信
‘0’和‘1’表示
RS485
RS485是一种串口接口标准,为了长距离传输采用差分方式传输,传输的是差分信号,抗干扰能力比RS232强很多。
RS-485:半双工、(逻辑1:+2V–+6V 逻辑0: -6V—2V)这里的电平指AB 两线间的电压差。
硬件框图如下
‘0’和‘1’表示
常见接口硬件图
COM口即串行通讯端口,简称串口。这里区别于USB的“通用串行总线”和硬盘的“SATA”。一般我们见到的是两种物理标准。D型9针插头,和 4针杜邦头两种。这是常见的4针串口,在电路板上常见,经常上边还带有杜邦插针。还有时候有第五根针,3.3V电源端。由于是预留在电路板上的,协议可以有很多种,要看具体设备。
UART有4个pin(VCC, GND, RX, TX), 用的TTL电平, 低电平为0(0V),高电平为1(3.3V或以上)。
D型9针串口(通俗说法)。在台式电脑后边都可以看到。这种接口的协议只有两种:RS-232和RS-485。不会是TTL电平的(除非特殊应用)。
USB转TTL串口的小板,可以用USB扩展出一个串口。
USB转RS-232串口
参考资料
边栏推荐
- 华三交换机配置SSH远程登录
- 618's money saving technology strategy is coming - experience the scene and get a 10 yuan cat super card!
- Part C - value types and reference types
- Gary Marcus wrote: three perspectives from linguists that AI researchers need to know
- How do the top ten securities firms open accounts? Is online account opening safe?
- 90%的人都不懂的泛型,泛型的缺陷和应用场景
- R语言使用nnet包的multinom函数构建无序多分类logistic回归模型、使用回归系数及其标准误计算每个系数对应的Z统计量的值、使用pnorm函数计算Z统计量对应的p值判断变量的显著性
- Can cold plate, submerged and spray liquid cooling lead the development of high-performance computing?
- 栈和队列的基本使用
- R language uses the polR function of mass package to build an ordered multi classification logistic regression model, and uses exp function and coef function to obtain the corresponding odds ratio of
猜你喜欢

【深入理解TcaplusDB技术】单据受理之事务执行

What are the conditions for a mature knowledge management?

Germancreditdata of dataset: a detailed introduction to the introduction, download and use of germancreditdata dataset

How to write vite plug-ins

Quickly understand the commonly used asymmetric encryption algorithm, and no longer have to worry about the interviewer's thorough inquiry

20 years' Shanghai station D question Walker (two points, concise)

What is the principle of live CDN in the process of building the source code of live streaming apps with goods?

MySQL使用ReplicationConnection導致的連接失效分析與解决

2 万字 + 30 张图 |MySQL 日志:undo log、redo log、binlog 有什么用?

Stick to five things to get you out of your confusion!
随机推荐
Analyse et résolution des défaillances de connexion causées par MySQL utilisant replicationconnection
栈和队列的基本使用
You call this shit MQ?
< Sicily> 1000. number reversal
ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked.
Principle analysis of three methods for exchanging two numbers
Synergetic process
POW consensus mechanism
The R language inputs the distance matrix to the hclust function for hierarchical clustering analysis, uses the cutree function to divide the hierarchical clustering clusters, specifies the number of
Packaging and unpacking process of ESP message under IPSec transmission mode
RestCloud ETL解决shell脚本参数化
MySQL single database and table splitting using MYCAT
R语言将距离矩阵输入给hclust函数进行层次聚类分析,使用cutree函数进行层次聚类簇的划分、参数k指定聚类簇的个数、给每个样本都分配了簇标签
20000 words + 30 pictures | MySQL log: what is the use of undo log, redo log and binlog?
POW共识机制
何小鹏:如果可以回到创业的时候 不会以自己的名字给产品命名
Tuikit audio and video low code solution navigation page
Has aaig really awakened its AI personality after reading the global June issue (Part 1)? Which segment of NLP has the most social value? Get new ideas and inspiration ~
4-way telephone +1-way Gigabit Ethernet 4-way PCM telephone optical transceiver
64 channel PCM telephone optical transceiver 64 channel telephone +2-channel 100M Ethernet telephone optical transceiver 64 channel telephone PCM voice optical transceiver