Electronic Design

Handy Circuit Converts RS-232 To An 8-Bit Discrete Output

This simple serial RS-232-to-discrete-output application and driver, based on Texas Instruments' 74LV8153, requires only a minimum of parts. The single-wire, RS-232 bit-compatible 74LV8153 supports an internal clock, auto-baud function, and output registers.

Graphic control written in Visual Basic (VB) gives this implementation a Windows-based feel. The circuit is intended as a resource for bench-switch or power-supply controls.

Referring to the schematic in Figure 1, it takes only a transistor (Q1), diode D1, and three resistors (R1, R2, and R3) to support the 74LV8153 8-bit serial-to-parallel interface IC (U1).

D2, C1, C2, R4, and the 78L05 regulator (U2) supply power to Q1, the transistor level shifter, and U1 directly from an RS-232 bus. Diodes D3 and D4 isolate pin 20, allowing a unique power-drive source up to 13.5 V, to drive the outputs.

The 74LV8153 serial-to-parallel interface's protocol includes three address bits for selection of eight devices, providing up to 64 discrete outputs for each serial link. In this application, pins 2, 3, and 4 are strapped, corresponding to A0, A1, and A2 for device address 000. The output drives may be defined as open collector or as active push-pull. Pin 6, OUTSEL, is strapped for its active push-pull output configuration.

A VB executable provides a toggle-switch graphic, text display, and send control box, plus the driver panel (Fig. 2). Clicking the graphic toggles the switch set, modifies the displayed graphic, and copies the Boolean setting to an array labeled as toggle_array(), as shown in the Partial Code Listing.

Clicking the "SEND" control box translates these stored values for D0 thru D7, and 3-bit device address, A0 thru A2, from the array into the 2-byte format required by the 74LV8153. It then displays the converted bytes in the text window and sequences them onto the RS-232 serial port and into the hardware shown in Figure 1. The serial port defaults to Port 1 but may be respecified to Port 2 by asserting the Port Select toggle.

The Partial Code Listing includes the algorithm that converts toggle_array bit values to the protocol needed by the SN74LV8153. The listing uses the passed toggle_array values and returns two character codes, B and C, which would be forwarded onto the serial bus. The full VB executable code (DB2144code.exe), as well as the code text listing (DB2144code.txt), are available in the online version of this article at www.elecdesign.com.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.