Electronic Design

  
Reprints     Printer-Friendly    Email this Article    RSS        Font Size     What's This?


[Ideas For Design]
Handy Circuit Converts RS-232 To An 8-Bit Discrete Output

William Grill  |   ED Online ID #10524  |   June 23, 2005


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.


Reprints   Printer-Friendly  Email this Article  RSS    Font Size   What's This?


  • Engineers Rely On Internet For Product Info
  • Rochester Electronics Establishes New Design and Technology Group
  • Custom Sources Light Way To 22-nm IC Lithography
  • In EDA, A Year Of Mergers, Failed And Otherwise
  • Software Turns Scopes Into Vector RF Signal Analyzers
  • Couple’s $15 Million Gift Advances Rice Engineering Education
  • November 7, 2008
  • Startup Sets Sail For Speedier Spice Simulation
    1) Ten Top Design Skills For Tough Times
    (7814 views today)
    2) Ultracapacitors Branch Out Into Wider Markets
    (549 views today)
    3) Energy Harvester Perpetually Powers WIreless Sensors
    (548 views today)
    4) Technology Has Been Very Good To Obama, And He Plans To Reciprocate
    (400 views today)
    5) Build A Smart Battery Charger Using A Single-Transistor Circuit
    (298 views today)
    ALL TOP 20



    Reader Comments

    Can anyone help> I would like to buy the TI circuit but cannot find any internet store offering it. Unfortunatelly there is no distributor for TI in Slovakia...

    Marian -December 23, 2006

    If i use a separate 5 volt supply, Do i need to tie pins 1,4 and 6 together for stable operation? I have seen some circuits that tie pin 6 &7 together. I would appreciate your help.

    carl mercier -October 16, 2006

    Sorry the submission messed up the format so much...

    Anonymous -May 12, 2006

    Here is C++ code that can be used to convert output bits setting to the two com chars to send to the LV8153:

    void Lv8153::outBitsToChars(unsigned char addr, unsigned char outBits, unsigned char& c1, unsigned char& c2) { // Output format to the LV8153 is // {St0 St1 A0-2 D0-3 Sp} {St0 St1 A0-2 D4-7 Sp} // where St0=0, St1=1, Sp=1 // St0 and Sp come directly from RS_232 protocol; // St1 to D3 and St1 to D7 come from the output chars (LSB to MSB) // So our output bits, MSB to LSB, are: // D3 D2 D1 D0 A2 A1 A0 1 // D7 D6 D5 D4 A2 A1 A0 1 addr &= 7;

    c1 = 1 + (addr << 2); c2 = c1;

    c1 |= ((outBits & 0x0f) << 4); c2 |= (outBits & 0xf0);

    return; }

    Anonymous -May 12, 2006

    Thank you all for your responses. It has been very satisfying to have so many people feel strongly enough to post so many comments. My submissions are usually developed with what you guys in mind, for publication that in most instances require more than a few hours to create and document.

    For those interested in schematic presentation correctness...GET OVER IT!! you have missed the point of the article and either should take a serious look at what is important to you, take this 'ism' as a challenge to submit your own idea, become a larger a player and ... 'get a life'.

    I believe readers are smart and will find more value in learning from what they read than from being manipulated by the author or editor and 'dumped' into a single application.

    William Grill -December 20, 2005   (Article Rating: )

    I'm having a belated second look at this circuit. You are teaching an old dog new tricks! Thanks. WB

    Waldo T. Boyd -November 20, 2005

    I'm just starting out in electronics and ran across this article. I would like to try it but have some other questions about it. Is someone willing to converse via email and help me along? Thanks in advance..... James (jimshourts yahoo com) (fill in the blanks)

    James -November 03, 2005

    please i want any equivelant for (74LV8153).

    or there is any one implement it using 8250

    uart ?

    Anonymous -July 29, 2005

    I got some of these chips a while back (TI will send you free samples in the DIP format), but couldn't get a response from them on the output pins. I'll try your schematic and exe program to see if I can get them to work. At least now I have info on a setup that does actually work. Using the cheap 74hct259 latching chips I should be able to get up to 120 individually controlled output lines per 74LV8153 chip (I've done this type thing using the 8 data pins on the parallel port).

    zoomkat -July 28, 2005   (Article Rating: )

    Bill;

    Great circuit and nice presentation of data. It was easy reading and a clear schematic.

    Fred Katz -July 27, 2005   (Article Rating: )

    To anonymous of 7/10/2005, inquiring about distributors of this device, preferably in DIP: I searched the TI website (www.ti.com) under that part number. The DIP version has an "N" suffix - TI says DigiKey stocks it but there's a 14 week delivery. If you just want a few, try contacting your local TI rep for samples, or even for other suggestions.

    Coincidentally, the Pease Porridge column in this same issue (ED online 10521) mentions kits that convert to DIP style.

    Hope this helps.

    Dick Roberts -July 24, 2005   (Article Rating: )

    very good circuit

    Juan -July 22, 2005   (Article Rating: )

    Nice circuit. How hard would it be to adapt to a USB port? Too many boards and PC's have forsaken the RS232C interface.

    D. Baker -July 12, 2005   (Article Rating: )

    Do any distributors sell 74LV8153s, preferably in DIP package?

    Anonymous -July 10, 2005

    One of the best Design Briefs I've seen in years! Thanks!

    Anonymous -July 05, 2005   (Article Rating: )

    It's amazing how a person tries to educate others to have people come down on him for the littlest of things. I don't have the best electronic background but i even understood what you meant. Great job. I learned alot from this circuit. I even have plans for this.

    Merlin Knight -July 05, 2005   (Article Rating: )

    It is a nice circuit, with a convenient usage of pin 20 (Vcc2 on datasheet) for level conversion and current boosting (if needed).

    G.Brelaz -June 30, 2005   (Article Rating: )

    My previous comment was not clear on the supply situation in case the terminal with D3 is not used. The circuit is supplied from the RS-232 source and the current is limited by what that source can provide. Thanks to the 74L05, the circuit itself is supplied with 5.0 V while the high output voltage on D0-D7 is 5.0 V - VD3 - voltage drop across the saturated output transistor or about 4.1 V when the OUTSEL terminal is set high.

    Per Nielsen -June 29, 2005   (Article Rating: )

    To the 6/28/05 comment: As the text says, the diodes allow the circuit to work either from power supplied from the RS-232 connector (in which case you have to accept the voltage (less the forward voltage drop across D2) and the current available from that source, OR you can connect your own higher OUTPUT voltage and draw any needed current through D3, while D2 cuts off the output power supply from providing power to (or preventing it from frying) the rest of the circuit. To both the 6/28/05 and 6/29/05 comments: The schematic should not surprise anyone. A 3-terminal voltage regulator cannot be misunderstood no matter how it is drawn, with or without terminal labels. I wouldn't have drawn it that way myself, but...

    Per Nielsen -June 29, 2005   (Article Rating: )

    While I can figure out the correct pinout of U2 (78L05), I second the first comment. For clarity, C2 could have been moved to the left of U2. Overall, a neat little circuit.

    Anonymous -June 29, 2005   (Article Rating: )

    I have never seen a 7805-type circuit shown with its input on the right and its output coming out the top, but gosh if that isn't what it looks like is being done in this circuit. It'd be nice to know for sure, you know, with some marking on the 7805 as to what was what.

    I also wonder exactly what the screw terminal second from the top right does, since it cannot be a power output and cannot power the circuit externally -- back to back diodes prevent it.

    Anonymous -June 28, 2005

    POST YOUR COMMENTS HERE
    Name:

    Email:
    Your Comments:

    Enter the text from the image below


    Please refresh the page if you have trouble reading this text.

    Search Electronic Design
         
      
     
    Email Newsletter
    Sponsored By:
    Electronic Design UPDATE provides readers with late-breaking news, opinions from industry experts, and timely technology stories. It's a unique opportunity to get your product message in front of engineers, engineering managers, and corporate managers while they're reading about critical information online.

    Enter Email to Subscribe
      

    Electronic Design Europe Electronic Design China EEPN Power Electronics Auto Electronics Microwaves & RF
    Mobile Dev & Design Schematics Find Power Products Military Electronics EE Events Related Resources