<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>

新聞中心

EEPW首頁(yè) > 嵌入式系統 > 設計應用 > 如何實(shí)現(電腦)PC機與單片機AT89C51的串行通信

如何實(shí)現(電腦)PC機與單片機AT89C51的串行通信

作者: 時(shí)間:2015-05-03 來(lái)源:網(wǎng)絡(luò ) 收藏

  org 0000h

本文引用地址:http://dyxdggzs.com/article/273495.htm

  ajmpstart

  org0023h  ;串行中斷入口

  ljmps&r

  org0100h

  start:mov tmod,#20h ;設置定時(shí)器T1方式2

  movpcon,#00h;使SMOD為0

  movtll,#0fdh;波特率為9600b/s

  movthl,#0fdh

  setbea;開(kāi)全局中斷

  clret1;關(guān)T1中斷

  setbes;開(kāi)串行中斷

  setbtrl;開(kāi)T1定時(shí)

  movscon,#50h;串行方式1,允許接收

  sjmp$

  S&r:movc,ri

  jcrecive;RI為1,執行接收子程序

  sjmpsend;否則,執行發(fā)送子程序

  recive:mova,sbuf;接收數據

  clrri

  cjnea,#52h,re;是否接收到“R”

  mova,#59h;是,發(fā)送“Y”

  movsbuf,a

  sjmpendtr

  re:mov @rl,a  ;r1為接收數據存放地址

  incr1

  sjmpendtr

  send:mova,@r0;發(fā)送數據,r0為存放數據的地址

  movsbuf,a

  jnbti,$

  clrti

  incr0

  endtr:reti;中斷返回

  3 結束語(yǔ)

  串口通信是一種廣泛應用于各個(gè)領(lǐng)域的通信方式,由于目前大部分計算機都安裝了Windows95操作系統,所以本文具體實(shí)現了在Windows95下利用它的SDK函數來(lái)與單片機進(jìn)行串口通信。本文所提出的實(shí)現函數在所有當前流行軟件如VC++、Delphi等中都可實(shí)現。它不僅可以用于近距離的RS-232通信,而且,還可以實(shí)現中遠距離RS-485通信。在使用該程序的通信系統中,近遠距離的通信都取得良好的效果。

51單片機相關(guān)文章:51單片機教程


單片機相關(guān)文章:單片機教程


單片機相關(guān)文章:單片機視頻教程


單片機相關(guān)文章:單片機工作原理


數字通信相關(guān)文章:數字通信原理


通信相關(guān)文章:通信原理


晶振相關(guān)文章:晶振原理

上一頁(yè) 1 2 下一頁(yè)

關(guān)鍵詞: AT89C51 PC

評論


相關(guān)推薦

技術(shù)專(zhuān)區

關(guān)閉
国产精品自在自线亚洲|国产精品无圣光一区二区|国产日产欧洲无码视频|久久久一本精品99久久K精品66|欧美人与动牲交片免费播放
<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>