EDN logo


Design Ideas: September 29, 1994

PC acts as RS-232C protocol analyzer

J S Holmes,
Boehringer Mannheim, Indianapolis

thumbnail The circuit in Fig 1 is an inexpensive and easy-to-build PC-based alternative to a dedicated protocol analyzer. The circuit taps into an RS-232C line between J1 and J2, and IC1's charge pump converts the RS-232C signals to CMOS levels. Many different types of RS-232C charge pumps work well in this circuit. One of the drivers in IC1 then converts the mixed signal back to RS-232C levels and transmits the data to the PC out of J3.

The PC must be running a monitor program to use this data. For applications in which the unit under test transmits and receives ASCII data, a commercial terminal emulator program, such as Procomm or Crosstalk, works well. If, however, the data on the signal line is binary, then Listing 1's QuickBasic program can make the data legible.

The program assumes a data rate of 9600 baud. You must make sure that the monitor baud rate matches the baud rate of the unit under test. The most efficient realization of this program involves putting the communication parameters in a file and reading it in at the beginning of execution. The program then goes into an infinite loop. The loop checks to see if there are any characters in the serial port, checks to see if the escape key is pressed, then repeats. In the event that a character comes into the serial port, it is displayed in ASCII and as a decimal equivalent. If you implement this program in a system that communicates with large numbers of characters, you can send the results to a file instead of to the screen. This will allow you to review the results of the communication attempt in a text editor.


| EDN Access | feedback | subscribe to EDN! |
| design features | design ideas | columnist |


Copyright © 1995 EDN Magazine. EDN is a registered trademark of Reed Properties Inc, used under license.