单片机与PC机串口通信的设计(7)
可以设置16条定时自动发送的数据,以及每条数据发送后的延时时间; 可以同时监控2个串口,利用特制电缆可监听2个串口设备之间的通讯过程; 发送数据时,可自动计算并添加和校验发送;
DTR自动控制是为了方便RS485通讯测试而添加的功能; 方便的查找功能,使你可以轻松搜索接收文本框中的字符; 使用快捷键可快速调用最近五次发送的不同数据。 5.4 结果
通过软件仿真,单片机可以向PC机发送数据,同时接收PC机发来的数据,完全实现了单片机
与PC机之间点对点的通信。由于5.12地震的影响,毕设暂停了一段时间,加之器材室元器件缺少我所需的器件,硬件电的路焊接也就没有完成。
第21页,共37页
6结语
实验表明,此系统完全实现了PC机与单片机之间点对点的通信,方法简单可靠,基本上在需要用到PC机与单片机串行通信的场合均可采用此种方法。随着近年来PC在国内应用范围的日益壮大,在工业控制、数据采集等领域越来越多的采用PC,本文可以算作是一个有益的尝试。当然在实际应用中还需要考虑一些问题,比如进行出错处理的问题,可以在一个要发送的字符串后再发送一个校验和,当收到返回的校验和与发送的校验和不一致时再进行重发,再比如所采用的RS232C传输距离很短,并且抗干扰能力很差,这时需要将总线转换成差分传输的RS485/RS422。另外,稍加改进,就可实现PC机与多片51单片机的串行通信,这时由于共用一条总线,必须给每个单片机分配一个地址,然后由PC机对总线进行仲裁,只有获得总线使用权的单片机才能与上位机进行通信,这里不再赘述。
总之,本文只是为PC和单片机串行通信提供了一个典型的范例,要应用到实际的项目中去,还需要根据实际的情况具体考虑,灵活应用,最终才能形成一个可靠的基于PC与单片机的串行通信系统。
第22页,共37页
参考文献
[1]王福瑞.单片微机测控系统设计大全[M].北京:北京航空航天大学出版社,1998.06 [2]李华.MCS一51系列单片机实用接口技术[M].北京:北京航空航天大学出版社,1993.07 [3]李朝青.PC机与单片机&DSP数据通信技术选编(1)[M].北京:北京航空航天大学出版社,2003.12
[4]刘金伍.单片机应用与实践[M].北京:北京航空航天大学出版社,1995.08 [5]刘大茂.智能仪器:单片机应用系统设计[M].北京:机械工业出版社,1998.04
[6]万福君,潘松峰.单片微机原理系统设计与应用[M].合肥:中国科学技术大学出版社,2001.01 [7][美]安格斯生.串行端口大全[M].精英科技译.北京:中国电力出版社,2001.01
第23页,共37页
附录A 英文资料
Linux PC and 51 series monolithic integrated circuit serial communication design Abstract: Introduced one kind uses Linux operating system PC machine carries on the correspondence through the serial port and the MCS-51 series monolithic integrated circuit the design method, has given the basic hardware principle and the signal procedure design 2 methods. The experiment proved that, this kind of plan simple reliable, the price is inexpensive, was Linux in domain and so on in industry control applications has provided one solution.
Key word: Linux; Monolithic integrated circuit; Serial communication; Industry control.
The monolithic integrated circuit performance stable, the price inexpensive, the function is formidable, in the intelligent instrument, industry equipment as well as in the everyday use electronic consumable obtained the more and more widespread application. In the monolithic integrated circuit input output control, except directly joins small methods and so on outside keyboard and LCD display monitor, generally all and on position machine PC carries on the correspondence through the serial port, but latter method because can realize the long-distance control, and can use the PC machine formidable data processing function as well as the friendly control interface, appears especially importantly. Carries on the control in general use PC machine to the monolithic integrated circuit the situation, all is uses Windows to take on the position machine platform, its merit is the contact surface is friendly, the programming and the operation quite is all easy, the shortcoming is the stability too is bad, this regarding needs the installment which the consecutive number day or several months move, is especially inappropriate. In the request quite harsh situation, all uses the UNIX workstation to take the master control platform generally, if the Hefei synchronization radiation accelerator master control platform uses is the SUN Solaris workstation system, however the UNIX workstation expensive price has limited its use scope greatly. In recent years, along with the Linux swift and violent development, caused it gradually to turn the mainstream operating system from small number of people's toy. Linux is follows the GPL agreement the free source code opening software, anybody all may free obtain its source program from Internet, also may revise its source code under the GPL agreement to adapt the specific application, its movement on ordinary PC, the performance is stable, is suitable for to make the industry control specially, therefore realizes Linux and the monolithic integrated circuit serial communication has the significance extremely, he may be the substitution method which the expensive UNIX workstation one kind may elect. 1 hardware principle …… 此处隐藏:1242字,全部文档内容请下载后查看。喜欢就下载吧 ……
相关推荐:
- [实用模板]第八章:法国“新浪潮”与“左岸派”
- [实用模板]2021年北京上半年临床医学检验技师生物
- [实用模板]SAP GUI 7.10客户端安装配置文档
- [实用模板]2001年临床执业医师资格考试综合笔试试
- [实用模板]36机场工作实用英语词汇总结
- [实用模板](一)社会保险稽核通知书
- [实用模板]安全教育主题班会材料
- [实用模板]濉溪县春季呼吸道传染病防控应急演练方
- [实用模板]长沙房地产市场周报(1.30-2.3)
- [实用模板]六年级数学上册典中点 - 图文
- [实用模板]C程序设计(红皮书)习题官方参考答案
- [实用模板]中国证监会第一届创业板发行审核委员会
- [实用模板]桥梁工程复习题
- [实用模板]2011学而思数学及答案
- [实用模板]初中病句修改专项练习
- [实用模板]监理学习知识1 - 图文
- [实用模板]小机灵杯四年级试题
- [实用模板]国贸专业毕业论文模板
- [实用模板]教育学概论考试练习题-判断题4
- [实用模板]2015届高考英语一轮复习精品资料(译林
- 00Nkmhe_市场营销学工商管理_电子商务_
- 事业单位考试法律常识
- 诚信教育实施方案
- 吉大小天鹅食品安全检测箱方案(高中低
- 房地产销售培训资料
- 高一地理必修1复习提纲
- 新概念英语第二册lesson_1_练习题
- 证券公司内部培训资料
- 小学英语时间介词专项练习
- 新世纪英语专业综合教程(第二版)第1册U
- 【新课标】浙教版最新2018年八年级数学
- 工程建设管理纲要
- 外研版 必修一Module 4 A Social Surve
- Adobe认证考试 AE复习资料
- 基于H.264AVC与AVS标准的帧内预测技术
- 《食品检验机构资质认定管理办法》(质
- ABB变频器培训课件
- (完整版)小学说明文阅读练习题及答案
- 深思洛克(SenseLock) 深思IV,深思4,深
- 弟子规全文带拼音




