UART Explained(转载)

news/2024/7/8 6:14:41

  做嵌入式开发,UART几乎是必不可少的,调试串口、GPS、GPRS、Bluetooth等模块很多都是用的UART接口。时下火热的IoT也不乏UART的身影,串口的BLE、WIFI、Zigbee、Lora等等模块,一堆一堆。前一篇提到的NUC972竟然内置了11个UART,也就可以理解了。虽然之前已基于串口做了很多工具软件,如S3C2410的烧录助手、WinCE串口调试助手、GPRS拨号助手、蓝牙模块调试助手等等,但现在搞IoT再弄串口,还是有必要整理一下这方面的知识,毕竟IoT跟教学实验设备甚至车载导航有很大不同,是不能够随便重启的。IoT产品可靠性要求极高,避免自己掉到坑里或者挖坑害了战友,花点时间整理UART相关知识是非常值得的。本篇转载的文章主要介绍了UART的基本特性,个人感觉写的非常好,具体如下。

Introduction to the standard serial bus

  UART (Universal Asynchronous Receiver/Transmitter) is one of the earliest modes of communication applied to computers, and its origins go back at least as far as the 1960s when it was used to connect minicomputers toteletypewriter machines — 'teletypes', as they were more commonly called. These were essentially electric keyboards able to transmit keystrokes to, and to print out responses from, the host. During the 1970s, UART was employed to allow early microcomputers to store and load programs and data from cassette tapes. In the following decades it was used to get personal computers talking to online services via modems.

  Until the arrival of USB, personal computers had serial ports to connect to other devices. UART was the underlying means of communication. Nowadays, UART is used primarily by microcontroller-based gadgets and by more sophisticated devices, including the imp.

  UART has had many names, but whatever it has been called, it always involves sending data over two wires — one for transmission, the other to receive incoming data. The information is transmitted one binary bit at a time; as such it is a 'serial' communications method. These bits are grouped together into 'frames' — a set format for conveying one meaningful piece of data.

  UART is said to be 'universal' because its parameters — speed, data size and so on — are not fixed and can be configured to meet the needs of a given communication requirement, though this means that both sides of the conversation need to have already agreed on these parameters. It is 'asynchronous' because it doesn't require a sender-provided clock to synchronize the transmission and receipt of data.

UART Signalling

  Because there is no clock signal per se, a 'start bit' is added sent first to tell the receiver to listen out for data. The receiver watches for a logic 'high' falling to logic 'low'. The receiver synchronizes its own bus clock to that bit.

  Following the start bit come the bits that that make up the 'word' being sent, with bit zero, the least significant bit, being sent first. The bits are sent as pulses on the wire at specific time intervals, set at both ends of the link to previously agreed values. The receiver looks at the voltage on the wire at these times; if it sees a logic high, it records a binary digit 1, or a 0 if the line is 'low', or 0V. The receiver checks half way between the start and the end of the pulse to ensure it doesn't mis-read the voltage on the line during the brief intervals while the voltage is rising or falling.

  If the two devices have agreed to use a 'parity bit' for rudimentary error-checking, that is calculated and sent next, in sync with the data that has been transmitted thus far. Finally, at least one 'stop bit' is sent by the transmitter.


A UART frame

  Word length, parity availability and type, and the number of stop bits all have to be agreed in advance.

  Because UART uses two wires — one, connecting device A's transmitter to device B's receiver, and the other, device B's transmitter to device A's receiver — the two participants can send each other data simultaneously, a mode of communications called 'full duplex'.

  原文链接: https://electricimp.com/docs/resources/uart/

  该网站有关IIC总线和SPI总线的介绍也相当不错,详见https://electricimp.com/docs/resources/index_hardware

  UART WIKI: https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter


http://www.niftyadmin.cn/n/3862790.html

相关文章

jetty服务器启动方法总结【备用】

1. 使用Java命令启动 java -jar start.jar ctrl c 关闭 终端窗口一直存在 2. 使用Java命令启动2 java -jar start.jar & 启动成功后敲回车即在后台运行 如果想查看控制台信息,此时进入jetty跟目录,会产生一个nohup.out 此时运行tail -f nohup.out 即…

[深度学习大讲堂]文化、进化与局部最小值

本文为微信公众号[深度学习大讲堂]特约稿,转载请注明出处 Reference:Culture vs Local Minima [Bengio.2012] 关于作者 首次看到Bengio教授这篇论文是在[对话机器学习大神Yoshua Bengio(下)] 这篇论文是提问时候偶然提到的&#x…

Android异步通信:深入剖析Handler机制源码

前言 在Android开发的多线程应用场景中,Handler机制十分常用今天,我将手把手带你深入分析 Handler机制的源码,希望你们会喜欢 Anroid Handler系列文章教程 Android异步通信:Handler机制学习攻略 Android异步通信:Hand…

iOS-LinkLabel

2019独角兽企业重金招聘Python工程师标准>>> 其实初学iOS开发就遇到这样的问题, 但是当初不知道该怎么搞, 使用labelbutton拼到一块的[笑哭]! 现在想想那时候真是SB.... 然后现在项目中可能要用到了, 专门看了一下, 今天主要找到了两个第三方, MLLabel和TTTAttribut…

Android多线程:继承Thread类、实现Runnable接口使用教程(含实例讲解)

前言 在Android开发中,多线程的使用十分常见今天,我将全面解析多线程中最常见的2种用法:继承Thread类 & 实现Runnable接口 Carson带你学多线程系列 基础汇总 Android多线程:基础知识汇总 基础使用 Android多线程:…

Carson带你学设计模式:动态代理模式(Proxy Pattern)

前言 今天Carson来全面总结最常用的设计模式 - 代理模式中的动态代理模式 Carson带你学设计模式系列文章 Carson带你学设计模式:这是一份全面 & 详细的设计模式学习指南 Carson带你学设计模式:单例模式(Singleton) Carson带你…

Carson带你学Java:带你一步步探索神秘的注解(Annotation)

前言 在 Java中,注解(Annotation)非常重要,但对于很多开发者来说,这并不容易理解,甚至觉得有点神秘今天,我将献上一份 Java注解的介绍 & 实战攻略,希望你们会喜欢。 目录 1. 简…

Android 中的MVP 模式

MVP模式的核心思想: MVP把Activity中的UI逻辑抽象成View接口,把业务逻辑抽象成功接口,Model类还是原来的Model。 MVC 其中View层其实就是程序的UI界面,用于向用户展示数据以及接收用户的输入而Model层就是JavaBean实体类&#xff…