当前位置:网站首页>【Popular Science Post】UART Interface Communication Protocol
【Popular Science Post】UART Interface Communication Protocol
2022-08-02 04:32:00 【Tiantian's little tiger】
I. Introduction to the Agreement
UART is a Universal Asynchronous Receiver/Transmitter, commonly referred to as a serial port in the industry.UART is a full-duplex communication mechanism, that is, sending and receiving are two relatively independent lines, and sending and receiving can be performed at the same time.
1, baud rate
The rate at which information is transmitted in a communication channel is called the baud rate, which is usually the number of bits transmitted per second, expressed in bit/s.The baud rates from low to high are: 2400, 4800, 9600, 115200, etc. You can also set them yourself, but the usual serial port tools usually only have these options.To facilitate debugging.Rarely use their own private provisions.
The reason why 2400, 4800, 9600 and 115200 are usually used: The baud rate unit is bit/s, which is binary bits/second.Because a byte is 8 bits, and a byte can usually express an ASCII code, such as an English letter, so: a channel with a baud rate of 9600 can theoretically transmit 9600/8 English letters per second., which is 1200 bytes.
UART uses a single data line for transmission and has no reference clock, so the transceiver must use the same baud rate to communicate and parse the data, and the clock error at both ends should not be too large, otherwise garbled characters will appear.
2. Communication data format

The serial port is high when the serial port is idle.When high becomes low, it is considered as the start bit.
The serial port transmits the low bits first, and then transmits the high bits, which is different from I2C, SPI and other signal transmissions that transmit the high bits first
The time width of the bit bit in the serial port transmission byte=1/baud rate
Second, hardware design
1, when the transmitter and receiver have the same level fields

2. Inconsistency between the transmitter and receiver level fields
1) Use resistor divider method
As shown in the figure above, the left side is 3.3V system, and the right side is 5V system. When the 5V level client sends data to the left side, the voltage is divided by two resistors, and the voltage of the left side receiving terminal is about 5V*2K/(1K+2K)≈3.3V, thus achieving level matching.
The TX of the left 3.3V system is usually directly connected to the RX of the right 5V system, or a 2K resistor is added between the two, and then a 1K pull-up is added to the 5V system side, so as to make the 5V side RX level meet the requirementslevel requirements.
2) Level conversion chip scheme, there are many products in this category, and I will not repeat them here
3) Transistor conversion scheme
The circuit in the above picture uses two NPN transistors, which can convert the input signal 3.3V level to 5V output level, and the signals remain synchronized.Circuit description: When TX is low, Q3 is off, Q4 is on, and RX is grounded low; when TX is high, Q3 is on, Q4 is off, and RX is pulled up to 5V.In this way, the two are synchronized high and low, and the level is converted.
The advantages of this circuit are low cost, strong driving ability, and relatively mature and extensive circuit applications.The disadvantage is that there is a delay in converting the waveform through the triode, so the rate cannot be too fast (the baud rate does not exceed 230400).When multiplexing, there are more materials, which requires a larger layout space.
边栏推荐
猜你喜欢
随机推荐
Temporal Segment Networks:Towards Good Practices for Deep TSN论文精读笔记
Spark MLlib特征处理 之 StringIndexer、IndexToString使用说明以及源码剖析
日志分析系统:ELK
使用批处理脚本修改hosts文件
electron-builder打包不成功解决方法
工业边缘网关究竟强大在哪里?
MQ-5 可燃气体传感器与 Arduino 接口
n皇后问题(回溯法)
如何在 Scala 中科学地操作 collection(一):集合类型与操作
synchronized锁原理详解
uniCloud address book combat
移动云物联网预研及阿里云开发对比分析
关于我的数学建模~
Modify hosts file using batch script
Binder机制详解(一)
18张图,直观理解神经网络、流形和拓扑
Glide中图片处理
【NTC 热敏电阻与 Arduino 读取温度】
Spark特征工程-归一化 和 分桶
【nRF24L01 与 Arduino 连接实现无线通信】









