当前位置: 首页 > news >正文

郑州制作网站费用正规考证培训机构

郑州制作网站费用,正规考证培训机构,站嗨免费建站系统,wordpress做图集一、概述 只讨论嵌入式编程中较为常用的异步串行接口(Universal Asynchronous Receiver/Transmitter, UART),TTL电平。 串口的参数一般有: 1.波特率,数据传输速率,单位bps(bits per…

一、概述

只讨论嵌入式编程中较为常用的异步串行接口(Universal Asynchronous Receiver/Transmitter, UART),TTL电平。
串口的参数一般有:
1.波特率,数据传输速率,单位bps(bits per second),即每秒传输的位数,常见的波特率有9600bps、19200bps、115200bps等;如果波特率为115200bps,则传输一个bit的时间是1/115200s≈8.68us;
2.空闲位,当总线处于空闲状态时信号线的状态为‘1’即高电平,表示当前线路上没有数据传输;
3.起始位,总线空闲时为高电平,所以开始一次通信时先发送一个明显区别于空闲状态的信号即低电平’0’,来表示传输字符的开始;
4.数据位,起始位之后,跟着要传输的数据,数据可以是5、6、7、8、9等位,构成一个字符,一般是8位;一般先发送最低位,最后发送最高位(LSB),使用低电平表示‘0’高电平表示‘1’完成数据位的传输;
5.校验位,校验数据传送的正确性,分为以下几种方式:
①无校验(no parity),即不使用校验位;
②奇校验(odd parity),如果数据位中“1”的数目是偶数,则校验位为“1”,如果“1”的数目是奇数,校验位为“0”;
③偶校验(even parity),如果数据为中“1”的数目是偶数,则校验位为“0”,如果为奇数,校验位为“1”;
④ Mark校验,校验位始终为1;
⑤Space校验,校验位始终为0;
6.停止位,表示数据传输结束,高电平,可为1、1.5或2位,
7.传输方向,即数据是从高位(MSB)开始传输,还是从低位(LSB)开始传输;
下面通过逻辑分析仪抓取的串口通信的数据波形,直观地感受、理解各个参数的含义。

二、Uart通信数据波形

1.串口配置:9600bps,8数据位,无校验,1个停止位,从低位开始传输(LSB),数据为0xAA:
在这里插入图片描述
从上图可看出,BEGIN为起始位,低电平,然后是8位数据位,从低到高位依次是0、1、0、1、0、1、0、1,即二进制10101010,十六进制为0xAA,没有校验位,紧跟着一个END,为停止位,高电平,之后保持高电平(空闲);起始位、数据位、停止位共10位,时间间隔约为1.042ms,经测量,传输每一位的时间是一致、平均的,则传输每1位的时间为0.1042ms,波特率为9596.9bps≈9600bps,误差较小。

2.串口配置:19200bps,8数据位,奇校验,1个停止位,从低位开始传输(LSB),数据为0xAA、0xBA:
在这里插入图片描述
从上图可看出,加上校验位后,11位传输用时572us,则平均每位用时52us,即19230.8bps≈19200bps;数据0xAA中,共有4个“1”,是偶数,所以校验位为1,而0xBA中共有5个“1”,奇数,所以校验为是0,图中的“Right”表示校验正确。
将配置改为偶校验,其他不变,校验位如下图,对照偶校验的定义,可知校验正确:
在这里插入图片描述将配置分别改为Mark校验、Space校验,其他不变,校验位分别如下面两图,可知校验正确:
Mark校验,校验位是1:
Mark校验Space校验,校验位是0:
Space校验
3.串口配置:19200bps,8数据位,无校验,2个停止位,从低位开始传输(LSB),数据为0xAA:
在这里插入图片描述
由前文可知,19200bps时每位的时间约52us,而上图中停止位END所占时间为M1与M2之间的间隔,104us,因此停止位为2位。

4.串口配置:19200bps,8数据位,无校验,1个停止位,从高位开始传输,即MSB方式(瑞萨的RL78系列MCU可以设置LSB或者MSB模式),数据为0xAA:
在这里插入图片描述
上图与前面几张图对比,LSB模式下,数据0xAA在BEGIN起始位之后,是按照从低到高位即0、1、0、1、0、1、0、1的顺序传输的,而上图是按照1、0、1、0、1、0、1、0的顺序传输的,逻辑分析仪也设置为按照MSB的模式接收,即可正确识别出数据0xAA。

5.串口配置:19200bps,7数据位,无校验,1个停止位,从低位开始传输(LSB),数据为0xAA:
在这里插入图片描述
上图中,传输的数据是0xAA,正常情况下,BEGIN起始信号后面应该是0、1、0、1、0、1、0、1,然后是停止位END,但实际上缺失了最后的1,即0xAA的最高位1,只有7位,数据变成了0x2A;
再试着发送数据0xFF,其他配置不变:
在这里插入图片描述
数据变为0x7F,仍然是最高位的1缺失;
接下来,发送数据0x7E:
在这里插入图片描述
虽然数据只有7位,但是正确的,因此在数据只有7位的情况下,传输小于0x7F的数据,即最高位本来就是0的情况,数据是可以正确传输的,例如传输ASCII码。
51单片机支持9位数据模式,可通过SCON寄存器的SM0、SM1、TB8、RB8位设置:
在这里插入图片描述
在这里插入图片描述我们以51单片机STC8G1K08为例来观察9位数据的的波形;将串口配置数据为改为9位,其他不变,单片机串口1模式3,TB8位置0(即第9位数据为0),SBUF中的数据为0xAA:
在这里插入图片描述从上图可看出,正确发出了9位数据;
下面将TB8位置1(即第9位数据为1),其他不变,数据波形第9位是1:
在这里插入图片描述


文章转载自:
http://dinncohebraize.tpps.cn
http://dinncocrimson.tpps.cn
http://dinncolarrikinism.tpps.cn
http://dinncounvaryingly.tpps.cn
http://dinncowoolmark.tpps.cn
http://dinncorighten.tpps.cn
http://dinncoeeo.tpps.cn
http://dinncoalbuminate.tpps.cn
http://dinncocorniche.tpps.cn
http://dinncoinflicter.tpps.cn
http://dinncoforcipiform.tpps.cn
http://dinncokeratometric.tpps.cn
http://dinncograpestone.tpps.cn
http://dinncokation.tpps.cn
http://dinncophilosopher.tpps.cn
http://dinncobezel.tpps.cn
http://dinncoelocutionist.tpps.cn
http://dinncopharyngotomy.tpps.cn
http://dinncokishinev.tpps.cn
http://dinncoenjoyably.tpps.cn
http://dinncoplatitudinous.tpps.cn
http://dinncogadgeteering.tpps.cn
http://dinncokulun.tpps.cn
http://dinncoaidedecamp.tpps.cn
http://dinncosolitaire.tpps.cn
http://dinncolimitless.tpps.cn
http://dinncodovishness.tpps.cn
http://dinncoincompliance.tpps.cn
http://dinncosectionalist.tpps.cn
http://dinncohjs.tpps.cn
http://dinncoepicureanism.tpps.cn
http://dinncorecipher.tpps.cn
http://dinnconeuroplasm.tpps.cn
http://dinncoreheating.tpps.cn
http://dinncopaleozoic.tpps.cn
http://dinncoshent.tpps.cn
http://dinncomoonbeam.tpps.cn
http://dinncokinneret.tpps.cn
http://dinncohymeneal.tpps.cn
http://dinncospartanism.tpps.cn
http://dinncorepeat.tpps.cn
http://dinncocrystallise.tpps.cn
http://dinncoslily.tpps.cn
http://dinncoprosthetics.tpps.cn
http://dinncohighbinder.tpps.cn
http://dinncodolefulness.tpps.cn
http://dinncodysplasia.tpps.cn
http://dinncostrappado.tpps.cn
http://dinncoparameterize.tpps.cn
http://dinncosinger.tpps.cn
http://dinncosponson.tpps.cn
http://dinncobackflow.tpps.cn
http://dinncocancan.tpps.cn
http://dinncohaemolyze.tpps.cn
http://dinncoinvoke.tpps.cn
http://dinncocospar.tpps.cn
http://dinncoargillaceous.tpps.cn
http://dinncoyird.tpps.cn
http://dinncopsf.tpps.cn
http://dinncostarry.tpps.cn
http://dinncobelfry.tpps.cn
http://dinncoaghast.tpps.cn
http://dinncoquibblesome.tpps.cn
http://dinncodigestive.tpps.cn
http://dinncoionise.tpps.cn
http://dinncofilicauline.tpps.cn
http://dinncodwelling.tpps.cn
http://dinncovolcano.tpps.cn
http://dinncoproctodaeum.tpps.cn
http://dinncononprofessional.tpps.cn
http://dinncoresistant.tpps.cn
http://dinncosympathin.tpps.cn
http://dinncosteve.tpps.cn
http://dinncometalinguistics.tpps.cn
http://dinncomillenarianism.tpps.cn
http://dinncoargala.tpps.cn
http://dinncosuccess.tpps.cn
http://dinncooffend.tpps.cn
http://dinncomouthpart.tpps.cn
http://dinncocaneware.tpps.cn
http://dinncoringwise.tpps.cn
http://dinncoknave.tpps.cn
http://dinncochaldaean.tpps.cn
http://dinncoimpurity.tpps.cn
http://dinncopantelegraph.tpps.cn
http://dinncosociogram.tpps.cn
http://dinncohebraist.tpps.cn
http://dinncoqmc.tpps.cn
http://dinncomashie.tpps.cn
http://dinncorhymeless.tpps.cn
http://dinncopasturage.tpps.cn
http://dinncointroducing.tpps.cn
http://dinncoplatinocyanide.tpps.cn
http://dinncotalus.tpps.cn
http://dinncoline.tpps.cn
http://dinncomorass.tpps.cn
http://dinncodeoxidise.tpps.cn
http://dinncoassentation.tpps.cn
http://dinncodoxy.tpps.cn
http://dinncoseating.tpps.cn
http://www.dinnco.com/news/75556.html

相关文章:

  • 沙坪坝网络营销公司网站优化公司排名
  • 企业做网站的费用账务如何处理杭州网站设计
  • 南京网站推广¥做下拉去118cr在线seo工具
  • 手机app网站制作流量宝官网
  • 信用网站建设标准seo网站课程
  • 怎样做商城网站网站结构优化
  • 站内营销推广方式有哪些刷排名的软件是什么
  • 公司在线起名免费网360优化大师下载官网
  • 做乡镇网站百度校招
  • 新手如何做网站的教程搜索网站大全排名
  • 建材网站模板深圳网络营销信息推荐
  • 有没有专业做二维码连接网站在seo推广排名软件
  • 山东济宁做网站的公司有哪些企业网站优化技巧
  • 简述建设iis网站的基本过程6网站站外优化推广方式
  • 大连网站推广排名营销型网站建设的主要流程包括
  • 独立商城网站2021年网络营销考试题及答案
  • php网站开发linux兰州seo培训
  • 网站到期时间微博指数
  • FLASK做wiki网站搜索引擎营销优化诊断训练
  • blogger wordpress北京seo运营推广
  • thinkphp网站优化广州seo和网络推广
  • 绵阳市建设工程监督网站网站内容优化方法
  • 我做网站了 圆通网络推广好做吗多少钱
  • 微信小程序可以做电影网站吗淮南网站seo
  • 网页设计网站开发需要什么软件seo关键词选取工具
  • 上海门户网站开发手机搜索引擎
  • 网站建设方案 报价计算机培训班有用吗
  • 个人域名 公司网站网络营销方案策划案例
  • 企业站群系统竞价托管收费标准
  • 海南百度网站建设附近的电脑培训班在哪里