当前位置:网站首页>Embedded basic interface UART
Embedded basic interface UART
2022-06-11 04:01:00 【z_ Curtain】
UART
Universal asynchronous transmitter receiver transmitter ,UART It's a universal serial data bus , For asynchronous communication . The bus communicates in both directions , Can achieve full duplex transmission and reception .
UART Pin
1、VCC: Power supply pin , In general 3.3V, In many embedded systems MCU On UART All controllers are internally powered .
2、GND: Ground pin , Both devices pass through UART When communicating, it is better to share , Otherwise, there may be problems with data reception .
3、RX: Data receiving pin .( From the other party TX)
4、TX: Data transmission pin .( From the other party RX)
5、RTS: The output signal , Used to indicate that the device is ready to receive data , Low level active , Low level indicates that the device can receive data .( May not be used )
6、CTS: Input signal , Used to determine whether data can be sent to the other party , Low level active , Low level indicates that the device can send data to the other party .( May not be used )
UART It's usually used 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 ).
Communication protocol
UART Its working principle is to transmit each character of the transmitted data bit by bit , To ensure the correct sending and receiving of data , Both sides of communication need unified configuration , This usually includes configuring the following 4 bits .
1、 Baud rate : A measure of the speed of data transmission . For example, the baud rate is 115200,8 Digit bit ,1 Stop bit , No parity bit , Then the data transmission speed is :115200/10*1024=11.25(KB/ second )
2、 Check bit : Used to verify the correctness of data transmission . Usually include 4 Verification methods , Odd check (ODD)、 Even check (EVEN)、 Check bit is 0(SPACE) The sum check digit is 1(MARK).
3、 Data bits : The number of data bits per transmission , Make a character , Usually use ASCII code .
4、 Stop bit : The end flag of a character data . Because the data is timed on the transmission line , And every device has its own clock , It's likely that there is a small out of sync between the two devices in the communication . So the stop bit is not just the end of the transmission , And provide the opportunity for the computer to correct the clock synchronization . The more bits apply to stop bits , The greater the tolerance of different clock synchronization , But the data transfer rate is also slower .
The basic structure
1、 Output buffer register : It receives CPU Parallel data sent from the data bus , And keep it .
2、 Output shift register : It receives parallel data from the output buffer , Move data bit by bit out at the rate of the transmission clock , Convert parallel data to serial data output .
3、 Input shift register : It moves the data appearing on the serial data input line bit by bit at the rate of the receiving clock , When the data is full , Sent in parallel to the input buffer register , Convert serial data into parallel data .
4、 Input buffer register : Receive parallel data from the input shift register , Then from CPU Take away .
5、 Control register : It receives CPU The control word sent , By the content of the control word , Determine the transmission mode and data format during communication . For example, asynchronous mode or synchronous mode , Number of digits of data characters , Whether there is parity , Odd check or even check , Parameters such as the number of stop bits .
6、 Status register : The status register stores various status information of the interface , For example, whether the output buffer is empty , Whether the input characters are ready, etc . In the process of communication , When in a certain state , The state detection logic in the interface will the corresponding position of the state register “1”, In order to make CPU Inquire about .
Reference link
https://baike.baidu.com/item/UART/4429746?fr=aladdin
边栏推荐
- Unity prefab scene 冲突合并工具 UnityYAMLMerge
- Docker builds a redis Cluster - three machines, three masters and three slaves
- Market prospect analysis and Research Report of Ethernet scanner in 2022
- 如何提高回归测试效率
- Course classification tree structure display
- [elt.zip] openharmony paper Club - multi tier storage hierarchical data compression
- Large factory outsourcing or self research company? How to choose a job for a tester?
- Source Insight 4.0设置注释与反注释的快捷键
- 三层带防护内网红队靶场
- Pthread in the multithreaded Trilogy
猜你喜欢

Detailed explanation of network time synchronization (NTP network timing) of video monitoring system

让人感到心灵平静,阳光温暖的图片
![[CNN]|CNN与Transformer区别](/img/ed/2b47387ba390a02c24bf9ff85b36e4.png)
[CNN]|CNN与Transformer区别
![[elt.zip] openharmony paper Club - Data high-throughput lossless compression scheme](/img/ed/4862c937f2d50bcf5d977527a143a6.png)
[elt.zip] openharmony paper Club - Data high-throughput lossless compression scheme

【网络篇】套接字编程

Large factory outsourcing or self research company? How to choose a job for a tester?

Kirin V10 installation of tongweb7.0

1_ Attribute management function

OpenGL error Guide

SQL注入关联分析
随机推荐
Quel genre de personne est heureuse?
7. list label
app直播源码,平台登录页面实现和修改密码页面实现
This artifact is highly recommended. One line command will convert the web page to PDF!
软件工程笔记之期末复习(简答)
三层带防护内网红队靶场
[elt.zip] openharmony paper Club - multi tier storage hierarchical data compression
SQL query users logged in for three consecutive days
A - Eddy's AC puzzle (C language)
Web upload file Preview
雷达辐射源调制信号仿真
基于SSM的大学生社团管理系统
手工测试转不了自动化测试,缺的是什么?
B - wall painting (C language)
Matlab reports an error when trying to use * * * as a function problem, and tries to execute script PCA as a function:
Eth Transfer
Market prospect analysis and Research Report of modular lithium ion battery in 2022
Object storage Minio tutorial
GPS Beidou time service, NTP makes network clock synchronization more accurate
Samsung Galaxy S21 ultra and Apple iPhone 13 Pro Max: which one should you choose