当前位置:网站首页>【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.
边栏推荐
猜你喜欢
![[Popular Science Post] I2C Communication Protocol Detailed Explanation - Partial Software Analysis and Logic Analyzer Example Analysis](/img/be/9b23a798557222bab68c67bf9170af.png)
[Popular Science Post] I2C Communication Protocol Detailed Explanation - Partial Software Analysis and Logic Analyzer Example Analysis

一文理解分布式开发中的服务治理

Gradle源码解析:生命周期的三个阶段

蓝桥杯:国二选手经验贴 附蓝桥杯历年真题

野火ISO-V2学习

Out of memory error on GPU 0. Cannot allocate xxxGB memory on GPU 0, available memory is only xxx

修复APP的BUG,热修复的知识点和大厂的相关资料汇总

Quo Vadis, Action Recognition? A New Model and the Kinetics Dataset I3D论文精读

VS2017报错:LNK1120 1 个无法解析的外部命令

属性动画的使用和原理解析
随机推荐
《scala 编程(第3版)》学习笔记2
【Arduino使用旋转编码器模块】
Binder机制详解(三)
Temporal action localization in untrimmed videos via Multi-stage CNNs SCNN论文阅读笔记
redo log与binlog间的破事
kotlin语法总结(二)
深度学习理论:测试集与验证集的区别及各自用途
[Popular Science Post] I2C Communication Protocol Detailed Explanation - Partial Software Analysis and Logic Analyzer Example Analysis
3D建模作品
Arduino D1----Mlx90614红外温度传感器接线和安装包
关于我的项目-实现一个数据库~
n皇后问题(回溯法)
Binder机制详解(一)
[Arduino connected to GPS module (NEO-6M) to read positioning data]
electron-builder打包不成功解决方法
Spark数据读取和创建
【科普贴】SD卡接口协议详解
Scala 中的集合(二):集合性能比较
同时安装VirtualBox和VMware,虚拟机如何上网
倍福ET2000侦听器使用