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.
Previous article:Introduction to current measurement and correct use of current probes
Next article:Three ways to quickly capture anomalies with an oscilloscope
- New IsoVu™ Isolated Current Probes: Bringing a New Dimension to Current Measurements
- Modern manufacturing strategies drive continuous improvement in ICT online testing
- Methods for Correlation of Contact and Non-Contact Measurements
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Some information about microcontroller controlling buzzer to play music
- Hiring embedded software engineer
- Common Problems and Solutions in RF Integrated Circuit Design
- Problems with the MP3302DJ
- How to modify the project name after IAR copies the project
- [National Technology N32G457 Review] SPI_ST7735 based on RT-Thread Studio
- Discussion on whether MicroPython has been successfully used in products
- From assembly, C language to FPGA, it can be concluded that none of these "three mores" can be missing!
- 【RT-Thread Reading Notes】Reflections on RT-Thread Learning Chapter 6
- I would like to ask how to adjust the speed of a brushless motor