首页 | 本学科首页   官方微博 | 高级检索  
     

STC单片机波特率自适应方法
引用本文:赵培宇.STC单片机波特率自适应方法[J].现代电子技术,2013(23):41-43,46.
作者姓名:赵培宇
作者单位:江汉大学机电与建筑工程学院,湖北武汉430056
摘    要:为了缩小电路体积、降低硬件成本,同时又保证串口稳定可靠通信,采用的一种波特率自适应方法,该方法充分利用STC单片机运行速度快、拥有片内振荡器、片内资源丰富的特点,在串行通信程序中,利用单片机I/O口和定时器,对主机发送的固定字符进行测量、计算,得到合适的波特率常数,从而实现波特率自适应。给出了设计原理、实现方法、误差分析、流程图和部分程序,并通过应用实例验证该方法切实可行。

关 键 词:STC单片机  串口通信  波特率选择  自适应方法

Baud rate adaptive method for STC single-chip microcomputer
ZHAO Pei-yu.Baud rate adaptive method for STC single-chip microcomputer[J].Modern Electronic Technique,2013(23):41-43,46.
Authors:ZHAO Pei-yu
Affiliation:ZHAO Pei-yu (School of Electromechanical and Architectural Engineering, Jianghan University, Wuhan 430056, China)
Abstract:To reduce circuit volume and hardware cost, and at the same time, guarantee the stable and reliable serial port communication, a baud rate adaptive method is proposed. This method makes full use of STC microcontroller's characteristics of high-speed running, on-chip oscillator, rich on-chip resources. In the serial communication program, the microcontroller's I/O port and timer are utilized to detect and calculate the fixed character transmitted by host for getting the right baud rate constant, so as to realize the baud rate self-adaption. The design principle and realization method, error analysis, flow chart and part of the program are also given in this paper. The feasibility of the method was verified by a true example.
Keywords:STC single-chip microcomputer  serial communication  baud rate selection  self-adaptive method
本文献已被 维普 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号