logo
Language
Home>New Measurement Visions > Application: Testing RS-232 Signal by an Oscilloscope
Application: Testing RS-232 Signal by an Oscilloscope
Release date: : 2020-01-07 14:49:23
1. Protocol Specifications
Almost every electronics engineer and electronics major has dealt with the RS-232 bus. The protocol specifications are also a must-learned aspect of electronics. Let’s review it together. Figure 1 shows the usual bit sequence of LSB (lowest bit first).

Start bit Data 0 Data 1 Data 2 Data 3 Data 4 Data 5 Data 6 Data 7 Parity(optional) Stop bit
1 bit 1 bit 1 bit 1 bit 1 bit 1 bit 1 bit 1 bit 1 bit 1 bit 1-2 bit

2. Connection Settings
Generally, when we use it, we operate as shown in Figure 2 below, using a USB to serial pinboard. Here I connect the left side to the USB port on the computer, and right side to the serial pin of the chip. After the LED on the pinboard is on, the test can be started. Open the serial debugging tool on the computer. There are many such tools on the Internet and they are similar. Just choose one to download and use. Open the corresponding serial port (COM26 here), set the corresponding serial port baud rate 115200, select None for the check bit, select 8 bits for the data bit, and 1 bit for the stop bit, as shown in Figure 3.


Figure 2   USB to serial connection


Figure 3   ComAssistant Setting

Then set the content to be sent. Enter “hello world” with the keyboard in the sending area, modify the automatic sending cycle to 50ms, check the automatic sending, and then click to open the serial port. At this time, the value of the Tx column on the ComAssistant interface increases automatically, and the LED on the TX pin of the pinboard blinks constantly in the meantime, indicating that the signal has been sent.
 
3. Signal Decoding Test
Next, turn on the UNI-T UPO2000E oscilloscope and adjust the trigger level to the appropriate location. A waveform as shown in Figure 4 can be seen. It is difficult for the human eye to see what the transmitted signal is through the displayed waveform. Now let’s use the RS232 decoding function of the UPO2000E to see what can be achieved.


Figure 4   Edge trigger waveform

Press the DECODE button, select the RS232 type, and select the positive polarity. The baud rate is 115200, the bit width is 8 bits, the bit sequence is LSB, the stop bit is 1 bit, and there is no check. Set the trigger condition to frame start. Then, the waveform is clearly and steadily displayed, as shown in Figure 5.


Figure 5   Frame start trigger waveform

So, how to interpret the signals? It is really too troublesome to count one bit by one bit. In regard to calculating each bit width by the baud rate, if it is a series of signals, it is difficult to distinguish the start and end. Now the decoding bus function of this oscilloscope comes in handy. Set the bus status on open and the transmitted data is "translated" on the screen, which is really convenient, as shown in Figure 6.


Figure 6   Enabling the decoding bus

We can see all the decoded data by moving left and right and adjusting the time base to compress the waveform. If only look at the waveform, it is almost impossible to distinguish the signals in it. But now, all the signals transmitted are displayed on the screen, as shown in Figure 7 below.


Figure 7   All data

The data on the bus is displayed in hexadecimal. Let's set the display format to ASCII code. Then the character "hello world" sent before is displayed on the screen, as shown in Figure 8.


Figure 8   ASCII display

Event list function is also very useful. Open the event list to see all the data streams in the transmission process, as well as the transmission time of the signal per frame, as shown in Figure 9. These functions can help us to debug the RS232 signal very conveniently, and no longer need to stare at the waveform and count one bit by one bit.


Figure 9   Event list

In the case of actual connection to the chip serial port, we can also see the situation of serial communication. As shown in Figure 10, the serial port information received by this oscilloscope is consistent with the information received by the ComAssistant.


Figure 10-1   Oscilloscope decoding and ComAssistant reception


Figure 10-2

For this UPO2000E oscilloscope, the RS232 decoding kit is standard, while for most other similar products, it is optional. So it is also quite cost-effective.