Guidelines for Troubleshooting Serial Communication Issues
When we are engaged in the development of embedded projects, we often encounter a variety of serial communication problems. According to the previous debugging and development experience, this paper summarizes a serial communication troubleshooting guide, hoping to provide some troubleshooting directions and methods for engineers who often use Serial to Ethernet Device Server.
Serial communication is a kind of communication mode that transmits data by bit between peripherals and computers, or between peripherals and peripherals through data signal lines, ground lines, etc. The communication format of this communication mode includes a start bit, data bit, check bit and stop bit, as shown in the following figure. Serial communication is characterized by low cost but slow transmission speed.The distance of serial communication can be from several meters to several kilometers.
After a brief introduction to serial communication, let's get down to business. The direction for us to troubleshoot serial communication problems is basically as follows, as shown in the figure.
1. Check the middleware
There must be a sending end and a receiving end in serial communication, and both of them pass through middleware (such as wires). In case of problems, the first thing is to ensure that the wires are connected normally. If this part is not determined and other directions are directly investigated, it is likely to do useless work.
2. Troubleshoot the hardware layer
The logic analyzer, oscilloscope, and other instruments are used to judge whether the pin waveforms of the sending end and the receiving end are normal during sending, receiving, and idling. When the serial port is idle, it is high level, and there will be a level change when there is data. It is also necessary to determine whether the voltage is normal. The position of waveform measurement starts from the endpoint, and then the detection points in the middle part are checked in turn to determine the location of the problem.
If waveform deformation, distortion, abnormal voltage, and other conditions are found, please ask the hardware engineer to assist in troubleshooting. The waveform is visible at its start point, but not at its endpoint, and a multimeter is required to determine if there is a cold solder joint on the pin.
3. Check the serial driver layer
If there is no problem after checking the hardware, but there is no waveform in the serial port of the sending end, it is necessary to check whether the serial port driver is configured successfully. The Tx and Rx pins at the transmitting end can be short-circuited for loopback tests. It is better to test with a simple routine first and try to eliminate the influence of multiple variables. When troubleshooting, special attention should be paid not only to the logic of the code, but also to the actual debugging, and be good at using the software debugging window to observe the values of the relevant registers.
4. Application protocol layer
Through the investigation of the above directions, it can be proved that there is no problem with spontaneous receipt. The next step is to verify whether the two sides can communicate normally. Possible problems at the application protocol layer include:
① There is a problem with the data protocol between the sending end and the receiving end, such as CRC, frame header and trailer check, and parsing of data packets.
② The serial port configuration parameters of the sending end and the receiving end: the baud rate and the check bit are inconsistent, resulting in the failure of communication.
We also need to pay attention to the following points:
① As the signal is easy to be interfered with, it is recommended to use a shielded wire, and the wiring must be strict, and it is better to ground if grounding is needed. For some 485 communication, it is also necessary to consider connecting a terminal resistor to match. If it is RS232 communication, try not to make the line too long.
② Because many devices have errors in the baud rate calculated by the external crystal oscillator or internal clock. In this case, if the message is too long, it will lead to the accumulation of errors, and then the serial identification will be garbled or can not be received.
③ In some places where there may be interference, you can consider using odd parity or even parity, so that you can filter out the wrong messages or try to use some data parity protocols to prevent data errors.
- |
- +1 赞 0
- 收藏
- 评论 0
本文由Vicky转载自usr News,原文标题为:Guidelines for troubleshooting serial communication issues,本站所有转载文章系出于传递更多信息之目的,且明确注明来源,不希望被转载的媒体或个人可与我们联系,我们将立即进行删除处理。
相关推荐
How to Solve the Problem of Serial Port Connection Failure
When using a serial port conversion device such as a Serial to Ethernet Device Server, you may encounter some obstacles. This article sums up part of the experience for engineers to make references when debugging.
What Are the Transparent Transmission Characteristics of Serial to Ethernet Device Server?
The serial to ethernet device server provides the function of converting serial port to network port, which can convert RS232/485/422 serial port to TCP/IP network interface, and maintain bidirectional and transparent transmission of statistical data between RS232/485/422 serial port and TCP/IP network interface.
The Function and Application of Serial to Ethernet Device Server
The serial to Ethernet device server is the core crystallization of the development of science and technology. Because of its wide range of applications, many applications can be involved. In this article PUSR will introduce the function and application of serial to ethernet device server.
PUSR Launched the Building Block Edge Gateway USR-M100, a Comprehensive and Scalable Data Transmission Gateway
PUSR launched the building block edge gateway USR-M100.M100 is a comprehensive and scalable data transmission gateway, which integrates the functions of Ethernet, 4G, transparent transmission, network IO, edge computing, MQTT and cloud platform fast access.
USR-N510, USR-N520, USR-N540, USR-N580 USR Cortex-M7 Series Serial to Ethernet Device Server AT Command manual
型号- USR-N540,USR-N520,USR-N510,USR-N580
USR-N5X0 Series Serial to Ethernet Device Server User Manual
型号- USR-N520-6,USR-N510-4,USR-N540,USR-N520,USR-N5X0 SERIES,USR-N510,USR-N540-4,USR-N5X0,USR-N580
IP Settings and Port Allocation Methods for Serial to Ethernet Device Server
In a word, a Serial to Ethernet Device Server is a necessary network device to realize the Internet of Things communication, remote control, and data acquisition. An excellent Serial to Ethernet Device Server should have industrial-grade, high-performance, and rich expansion functions.
有人物联(usr)以太网系列产品选型指南
描述- 山东有人物联网股份有限公司定位“可信赖的智慧工业物联网伙伴”,以“连接价值、价值连接”为使命,深耕工业联网产业价值链上下游,专注于通讯产品的研发、生产及销售,是业内领先的工业物联网软硬件解决方案服务商。集团现拥有员工600余人,已累计融资近2亿元,拥有自建工厂,具备从芯片到云端的全产业链服务能力。致力于为客户提供通讯终端、物联网模块、云平台服务及物联网解决方案。
型号- USR-W600,USR-K7,USR-K6,USR-N510,USR-CANET200,USR-TCP232-T2,USR-SDR080,USR-SDR160,USR-SDR041,USR-M511,USR-SDR021,USR-N668,USR-TCP232-ED2,USR-TCP232-E2,USR-N540,USR-N520,USR-N580,USR-W630,USR-W610,USR-TCP232-S2,USR-SDR050,USR-TCP232-306,USR-TCP232-410S,USR-TCP232-304,USR-TCP232-302
水利应用全场景揭秘,有人物联响应时代号召,打造行业产品新高度
有人物联响应时代号召,深研水利行业应用十大场景,围绕智慧水利、智慧灌区、高标准农田、水库大坝安全监测、测控一体化闸门等核心板块,提供完整完善的有人水利行业产品组合。
【经验】解析串口服务器USR-TCP232-410如何使用485口并联方式与设备通信
本文主要介绍串口服务器USR-TCP232-410使用485口并联方式与设备通信。有人物联410的485口最大支持32个设备,485总线协议标准是200多个,实际连接还需要设备的负载决定。
鼎桥CEO莅临有人物联参观交流,深化5G战略合作
在数字化转型浪潮的推动下,物联网技术的融合创新成为推动工业产业升级的关键力量。近日,行业领先的物联网解决方案服务提供商——有人物联,与享誉全球的通信解决方案供应商鼎桥通信技术有限公司,正式签署战略合作框架协议。此次合作不仅标志着双方在5G RedCap工业通信领域达成战略合作,也预示着双方共同推动物联网技术与产业的深度融合的坚定决心。
【电气】有人物联白金系列工业级交换机,工业防雷6000V,专为严苛工业环境设计
白金系列是有人物联推出的5口/8口、百兆/千兆工业级以太网交换机,专为严苛工业环境而设计。满足轨道交通、平安城市、智能交通、安防监控和其他恶劣环境中的部署要求,为用户的以太网设备提供可靠、便捷的联网解决方案。
有人物联网双网口8串口的串口服务器USR-N580,独特的工业功能支持,支持Modbus网关功能
为了能为客户降低成本和减少布线难度,有人物联网研发出了一款双网口8串口的串口服务器,专门应用于多设备联网的复杂环境。八串口服务器USR-N580,是用来将TCP/UDP数据包与RS485接口实现数据透明传输的设备。 独特的工业功能支持,支持Modbus网关功能,更加方便工业现场使用。 支持网络打印,打印机行业使用更加方便。
【选型】有人物联WiFi6工业无线客户端、小体积5G工业数传终端满足AGV小车联网需求,确保通信稳定
AGV小车要不断移动就要依靠稳定的无线通信网络覆盖,以及快速的AP间漫游切换,保证各工业场景中AGV的高效稳定工作。AGV无线通信组网系统要具备较大带宽,支持实时双向通信,能够承载诸如高清视频、机器人/车辆运行数据、传感器数据、语音及其他网络业务。有人物联新推出的WiFi6工业无线客户端W660和小体积5G工业数传终端G815可助力AGV+物联网推动各行各业数字化转型升级。
电子商城
登录 | 立即注册
提交评论