Test Ideas: Serial port tests digital circuits

Check TTL signal levels using a PC’s serial port and a simple application.

By Yury Magda, Consultant, Cherkassy, Ukraine -- Test & Measurement World, 2009-04-01 02:00:00 EDT



Have a test idea you'd like to share?
Publish it here and receive $150.
Send us your ideas.

Also:
Read other Test Ideas
Read Design Ideas published by EDN

pdf button

A PC’s serial port provides signal lines that you can use to expand the number of input signals. With some additional circuitry tied to these lines, you can use the port to test digital TTL logic-level circuits. You just need to convert the TTL logic levels to RS-232 voltages and add a multiplexer to increase the number of signals that the serial port can sense.

The schematic in Figure 1 (shown at the end of this article) uses a MAX232 IC to convert RS-232 voltage levels to TTL-logic levels. A 74HC4051 multiplexer lets you select any of four digital inputs and route them to the serial port. Software available from the online version of this article lets you control the RTS (ready to send) and DTR (data terminal ready) pins in the serial port that select the signal under test. The CTS (clear to send) pin then reads the signal under test into the PC.

Download the software that lets you control the RTS (ready to send) and DTR (data terminal ready) pins in the serial port that select the signal under test.


The four digital-input signals (A0–A3) from your device under test connect to the first four inputs (X0–X3) of the multiplexer. Only one of those signals can pass through to the X output (pin 3) at a time. By setting the appropriate binary code on the serial port’s RTS and DTR lines, you can select the signal to pass through the multiplexer. Table 1 describes the selection of inputs.


Table 1. Binary codes for 
the multiplexer inputs
Signal to X pin RTS bit DTR bit

A0

0

0

A1

1

0

A2

0

1

A3

1

1

The PC software, running on Windows XP, sequentially sets those binary combinations on the port’s RTS and DTR lines and reads the digital signal on the CTS line. When you click the “Check status” button on the user interface, the software reads and displays the status of the selected bit.

The code is written in Microsoft C# .NET 2008, but it will run on the 2005 version as well. To create the application, launch the project wizard and select the “Windows Forms Application” from the C# .NET templates. Place the TextBox, Label, and Button components on the project’s main form and assign titles to them. You should place the SerialPort component on the design area of the project. Then, set the appropriate parameters for the SerialPort component (port number, baud rate, data bits, and parity and stop bits).

When you build the circuit, follow all precautions in the manufacturers’ data sheets concerning the wiring of the MAX232 and 74HC4051. Remember to place bypass capacitors as close as possible to the IC’s power and ground. You can replace the MAX232 with a MAX225 or MAX233, neither of which requires external components.


Figure 1




Figure 1. This circuit lets you pass up to four TLL-level signals to an RS-232 port to read their status.

Home   |   Contact Us   |   View Full-Sized Site
© 2011 UBM Electronics . All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy