期刊文献+

一种基于状态机的串口通信协议的设计与实现 被引量:28

Design and implementation of serial port communication protocol based on state machine
在线阅读 下载PDF
导出
摘要 为解决串口通信中的数据传输容易出错、可靠性差、安全性不高且容错能力低等问题,设计并实现了一种基于状态机的串口通信协议,并将此协议应用到称重仪表的上位机通信中。本文介绍了串口通信协议的数据包格式以及其通信状态机,并给出了协议实现的部分示例代码及算法流程图。在数据包格式定义中通过设置起始标志、数据长度、校验、结束标志等字段,保证数据传输的正确性;并在数据包接收过程中引入状态机方法,简化编程模型的同时,提高了通信过程的可靠性、安全性以及数据传输的容错能力。 A serial port communication protocol based on state machine which is designed and implemented in order to solve the problems such as data transmission errors,poor reliability,low security and fault tolerance,is applied to a weighing instrument's PC communication.This paper mainly describes the serial port communication protocol data packet format and its communication state machine,and also gives some code of the protocol and algorithm flow chart Start flag,data length,calibration,and end flag are set to ensure the correctness of data transmission.And state machine is used in the data packet receiving course to simplify programming model,and improve the reliability,security and fault tolerance.
作者 李莹 贾彬
出处 《电子设计工程》 2012年第7期100-103,107,共5页 Electronic Design Engineering
关键词 状态机 串口 通信协议 ATmega168 线程 state machine serial port communication protocol ATmega168 thread
  • 相关文献

参考文献6

二级参考文献8

  • 1张鲁国,马自堂.智能卡操作系统中存储管理设计[J].微计算机信息,2005,21(08X):18-19. 被引量:18
  • 2石东海主鳊.单片机数据通信技术从入门到精通[M].西安:西安电子科技大学出版社,2002..
  • 3Stewart R R, Xie Qiaobing. Stream Control Transmission Protocol (SCTP). A Rcference Guide . Addison-Wesley Pub. Co., Bk&CDRom Edition, 2001-12
  • 4(美)Christa Anderson.Mark Minasi.Mastering Local Area Networks[M].出版社Sybex,1999.
  • 5张永瑞,杨林耀,张雅兰.电路分析基础[M].西安电子科技大学出版社,2001.
  • 6Barry B.Brey.Programming the 80286,80386,80486,and Pentium-Based Personal Computer[M].电子工业出版社,1998.
  • 7江晓安,董秀峰,杨颂华.数字电子技术[M].西安电子科技大学出版社,2002.
  • 8吕松茂,韩震宇,李晓东.用PComm处理Windows环境下的串口通信[J].计算机工程,2001,27(6):176-177. 被引量:14

共引文献71

同被引文献175

引证文献28

二级引证文献84

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部