Troubleshooting process for communication anomalies caused by baud rate drift

Publisher:心灵律动Latest update time:2019-11-25 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The protocol decoding function of the oscilloscope is familiar to everyone. Have you ever experienced that the waveform looks normal, the protocol parameters and decoding settings are correct, but the decoding cannot be performed normally? This article takes the UART protocol as an example to share the troubleshooting process of abnormal communication caused by baud rate drift.


What is baud rate drift? It can be understood that the crystal oscillator of the tested component has deviation, resulting in the inconsistency between the actual baud rate and the normal baud rate. Why does baud rate drift lead to communication anomalies? This article starts with the waveform and takes you to self-check the decoding results.


1. Troubleshooting of communication abnormalities caused by baud rate drift

Here is a real example: the serial data sent by the PC is "0xEE 0x61 0x32 0xFF 0xFC 0xFF 0xFF", and the oscilloscope decoding result is "0xEE 0x98 0xF6 0xFC 0xFF", which preliminarily determines that there is a communication failure. However, the protocol parameter settings and decoding settings are correct, so why is there an inconsistency between sending and receiving?

The following article takes the decoding results of the waveforms of 9600 bps and 10126 bps as an example, with the baud rate in the protocol parameter settings set to 9600 bps and the actual baud rate set to 9600 bps and 10126 bps (as shown in Figure 1), and shares the process of troubleshooting the cause of communication abnormalities caused by waveform deviations due to baud rate drift.

Figure 1 Different waveform decoding results at the same decoding baud rate

First, let's talk about the decoding principle of UART. When the oscilloscope decodes the UART signal, it takes the falling edge after the idle level as the start bit, and then samples from the waveform at equal intervals, and takes the majority of the states in the sampling points within the equal interval time period as the decoded value of the bit. Waveforms with different baud rates have different minimum data bit widths, and the time T = 1/sampling rate. The actual waveform with a large sampling rate has a smaller corresponding time, so it can be seen from Figure 1 that the waveform with a baud rate of 10126bps is offset to the left.


When the baud rate set during decoding is the same as 9600, the position of the sampling point is determined based on the baud rate of 9600. When the actual sampling rate deviates from 9600bps, the error will gradually accumulate, resulting in a deviation in decoding. The larger the data bit width is set, the easier it is to accumulate errors.


2. Self-test baud rate method

Starting from the waveform, the baud rate is estimated based on the minimum bit width of the waveform. This method is suitable for when the baud rate deviation is large or the baud rate setting is uncertain. This is the self-test method that engineers are more accustomed to. To estimate the baud rate, you need to look at the minimum bit width in the waveform. From Figure 2, the time base gear is 100us, and the minimum bit width just occupies one grid, so the minimum bit width is about 100us, which is equal to 10000bps after conversion.


To get a more accurate baud rate value, you can use the measurement function of the oscilloscope. Open [Measure] in the oscilloscope panel, select the baud rate measurement item, and compare the baud rate measurement results, as shown in the red box in Figure 2.


The example mentioned at the beginning was caused by the baud rate drift. The actual baud rate was 10000 bps, but the decoding was set according to the normal component 9600bps. The baud rate error was greater than 4%, which led to incorrect decoding results. After changing the crystal oscillator and decoding again, the communication was normal.

Figure 2 Estimating the baud rate from the minimum bit width of the waveform


Summarize

Although the baud rate is only a parameter in decoding, its drift cannot be ignored. It may be the factor that causes communication failure. Before decoding, pay attention to checking the baud rate. Such a small detail may save time for troubleshooting in the future. Starting from the waveform, re-examine the value of the oscilloscope. It is used to observe waveforms and analyze data in order to detect whether the tested components are normal.


Reference address:Troubleshooting process for communication anomalies caused by baud rate drift

Previous article:Introduction to current measurement and correct use of current probes
Next article:Three ways to quickly capture anomalies with an oscilloscope

Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号