Home | Products | Software | Download | News | Search | F.A.Q. |        

Classroom

 

Measuring RS-232 signals

print

The TiePie engineering pc based measuring instruments are also suitable for measuring RS-232 signals. This measurement can be performed using the oscilloscope.

Measuring an RS-232 signal: oscilloscope

For this measurement example, a normal (double female) RS-232 cable with a DB-9 connector connected to COM-1, is used. Hyperterminal is the program that transmits the data through the COM port. The HP-6350 is used to measure the transmitted data bits on pin 2 of the DB-9 connector on the other side of the cable. The purpose of this measurement will be to display the characters tiepie according to the RS-232 standard on the oscilloscope of the TiePie engineering Windows measurement software.

Before we start the measurement, we will need to know what is to be expected on the oscilloscope. Therefore, the ASCII table will need to be checked to see what tiepie is in binary code. The results can be seen in the first and second column of the table.

The RS-232 protocol specifies that the Least Significant bit (LSb) is sent first and the Most Significant bit (MSb) last. Therefore, the bits in the ASCII table need to be flipped horizontally. The result is listed in the third column of the table.

Whenever a character is sent according to the RS-232 protocol, a start bit is added to the data. This start bit is a '0'. At the end of the transmitted character a stop sign has to be added as well. However, this is user dependant. Available options are 1, 1.5 and 2 stopbits. For this measurement, 1 stop bit is selected.

Unlike normal TTL signals, a '0' and a '1' as specified by the RS-232 protocol are not 0 and 5 volts or thereabouts, but approximately -12 and +12 volts. To make it even more confusing, the data bits are flipped. This means that a logic '0' is a '+12' and a '1' is a '-12'. When there's no data signal is present, the output signal remains at '-12'.

To simplify the interpretation of the output of the RS-232 protocol, it is advised to invert the channel on which the RS-232 signals are measured. This is easily achieved by clicking on the invert button or by pressing 'i' in the oscilloscope of the Windows software.

Character ASCII: MSb -> LSb ASCII: LSb -> MSb Full
t 111 0100 001 0111 0 001 0111 01
i 110 1001 100 1011 0 100 1011 01
e 110 0101 101 0011 0 101 0011 01
p 111 0000 000 0111 0 000 0111 01
i 110 1001 100 1011 0 100 1011 01
e 110 0101 101 0011 0 101 0011 01

We're now ready to perform the actual measurement. First, make sure that the probe is connected to one of the channels on your measuring equipment. Connect one of the sides of the (double female) to the COM-1 port of your computer and connect the probe to pin 2 of the DB-9 connector. This is especially easy if you have a cable that has female connectors on both ends. The ground connector of the probe does not need to be connected to the DB-9 connector. However, make sure that it does not accidently touch the measured pin on the DB-9 connector, as this will cause a short-circuit to occur.

Start up Hyperterminal. Hyperterminal can be found in Start > Programs > Accessories > Communications > Hyperterminal or goto Start > Run and type hypertrm and hit 'enter'. A popup window should come up asking to initiate a new connection. Give a suitable name to your connection and click 'ok'. Select 'Com 1' in the 'Connect through' box and click 'ok' again.

In the port settings dialog, select the following options:
  • Bits per second: 110
  • Databits: 8
  • Parity: None
  • Stopbits: 1
  • Data transport control: None
Finally, click the 'ok' button again.

Next up is the TiePie engineering software. Choose the oscilloscope on the instrument taskbar. When the oscilloscope window is loaded, use the 'i' button to invert the channel. Since we're working at a relatively low baud rate, it is recommended to lower the sampling frequency to something like 10kSamples per second. This can be set by right-clicking on the time axis and picking the right sampling frequency from the popup menu. The transmission of the word tiepie shouldn't take a second, so the record length can be set to 20 000. We now have a recording time of two seconds maximum, one second pre-trigger and one second post-trigger.

Now all we need to do is set up the trigger right. We only want to capture the transmission, so we let the trigger respond to the first transition that appears during the transmission of the word tiepie. But as we don't know yet when that transition is going to occur, we will have to tell the trigger system that it has to wait an infinite time until our required condition is met. This can be achieved through an infinite trigger time out setting. Rightclick on the trigger symbol, find the menu Time out and tick the box in front of Time out infinite. The same setting can also be set by pressing 'w' on your keyboard. The level at which the trigger needs to be set is not that strict. As long as it is a few volts above the level the signal has during a logic '0', it should be right. If you're still uncertain, refer to the image at the top to get an indication.

We only want to perform a single measurement, therefore the One shot button needs to be pressed to start the measurement itself.

When the characters tiepie are now typed in the main Hyperterminal window, the transmission should be started. As soon as the first transition occurs, the measurement should start as well. When the end of the record is reached, the measurement is automatically stopped. If everything went well, you should see the same signals as in the image at the top of this page.

Measuring an RS-232 signal: 't' in RS-232

The image above shows the result for the first character of the word tiepie, which is a t. The bitsequence that was earlier established as a t according to the RS-232 protocol, can be verified now.
000 1 0 111 0 1

Correct!

Ofcourse, the use of Hyperterminal during this measurement is solely intended to generate general RS-232 signals. In a normal situation, the RS-232 signals would most likely be present and you would be interested to see what is actually being transmitted. This example simply provides a useful walkthrough of the necassary parameters to setup the oscilloscope to capture the RS-232 data you're interested in.

print