Design Idea
Serial port tests digital circuits
Check TTL signal levels using a PC’s serial port and a simple application
Yury Magda, Cherkassy, Ukraine; Edited by Martin Rowe and Fran Granville -- EDN, 6/25/2009
A PC's serial port provides signal lines that you can use to read voltage levels of digital circuits. You can use the port to test digital TTL (transistor-to-transistor-logic)-level circuits. You just need to convert the TTL levels to RS-232 voltages, and you can add a multiplexer to increase the number of signals that the serial port can sense.
The circuit in Figure 1 uses a MAX232 IC from Maxim to convert RS-232 voltage levels to TTL levels (Reference 1). A 74HC4051 from Texas Instruments lets you select any of four digital inputs and route them to the serial port (Reference 2). Listing 1 lets you control the RTS (ready-to-send) and DTR (data-terminal-ready) pins in the serial port that selects the signal under test. The CTS (clear-to-send) pin then reads the signal under test into the PC.
|
The four digital-input signals, A0 through A3, from your device under test connect to the first four inputs, X0 through 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).
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. The software then reads the status of the selected bit and displays it when you press the “check-status” button (Figure 2). The code is written in Microsoft C# 2008, but it will run on the 2005 version, as well.
To create the application, select the “Windows Form Application” from the templates in the project wizard. Place the text-box, label, and button components on the project's main form and assign titles for them. You should place the serial-port component on the design area of the project. Then, set the appropriate parameters for the serial-port component, including the port number, baud rate, data bits, parity, and stop bits.
When you build the circuit, follow all precautions concerning the MAX232 and 74HC4051 wiring according to the manufacturers' data sheets. Place bypass capacitors as close as possible to the IC's power and ground. You can replace the MAX232 with a MAX225 or MAX233.
| References |
|
















