Connect with us

RS-232 levels to computer

Discussion in 'Electronic Design' started by [email protected], Mar 10, 2006.

Scroll to continue with content
  1. Guest

    Hi All,

    I understand that standard RS-232 levels must be bipolar with at least
    a -3V for a logic "1" and +3 volts for logic "0".

    The micocontroller 232 level is TTL level, I use this signal to drive a
    NPN so the the signal is inverted and use +12 on the collector to get
    the level. The lowest voltage out of the NPN will be near zero. I am
    using this for just collecting some data sent over a small cable lengh
    and I don't plan on this being part of a design.

    The question is in regards to the computer RS-232 input, would the near
    zero voltage be taken as by the com port as the correct level?

    Tnx de PDRUNEN
  2. Jim Thompson

    Jim Thompson Guest

    Yes. (Most RS232 ports don't actually follow the spec.)

    ...Jim Thompson
  3. John Fields

    John Fields Guest

  4. Joel Kolstad

    Joel Kolstad Guest

    ....driven into a 1k load, or something like that.
    In many (even most) cases, yes, but if you're designing this as as real
    product (not just a one-off device for yourself & friends), in a room full of
    miscellaneous computers you can assuredly find a machine that *won't* accept
    ground as being a logical 1. (It tends to be more older computers.)

    For a real product, I would just use a Maxim 3311E and know I'm meeting the

    ---Joel Kolstad
  5. All the technical spec's suggest it shouldn't work but on 2 of my PCs
    actually works well. For testing purposes saves the ballache of finding a
    negative rail.
    Would seem those highly specified RS232 Com ports are nicely 5V-logic
  6. Tim Wescott

    Tim Wescott Guest

    Not reliably. Fortunately the RS-232 connector gives you both voltages
    as part of its signaling (someone please post what they are!). If I
    were doing this I'd do a web search on "port powered RS-232" or some
    such, then I'd implement a circuit that looks like this:

    | | R2
    | | 2k2
    | TX
    R1 |
    4k7 Q1 |
    TXdata ___ |/
    o-------|___|--- ----o------| Q2
    v / | |>
    --- | |
    | .-. |
    | | | R3 ===
    === | | 4k7 -12
    GND '-'
    (created by AACircuit v1.28.6 beta 04/19/05

    Q1 is a PNP level shifter, R1 limits the emitter current of Q1 to around
    1mA (for a 5V VCC). Q2 is an NPN inverter. R3 guarantees that Q2 will
    shut off smartly.

    Dunno how well this will work, I've never actually implemented it --
    I've just seen similar arrangements elsewhere & thought they looked
    clever. There really ought to be a chip out there that does this for
    you, but I've never had occasion to really dig for one.


    Tim Wescott
    Wescott Design Services

    Posting from Google? See
  7. FAIK the specs want +/-5V at the transmitters and +/-3V at the receivers. I
    ever got a circuit that worked well using TTL-levels... most of the time.
    The trouble did me decide never to use TTL to RS232 so I always used 1488/89
    (later MAX232) ever since.

    petrus bitbyter
  8. Like others said: maybe, maybe not. One simple way of doing it is as
    follows: driver the led of an optocoupler. Connect the emitter to RTS,
    collector to RxD, a resistor of 2k2 from collector to DTR. Make sure your
    software activates RTS and deactivates DTR. this will provide power to the
    transistor. Now you'll get a fully bipolar signal AND galvanic isolation for

  9. Yes, it will be, almost certainly. The actual thresholds in receivers
    are almost always somewhat above zero volts.

    This is an okay solution if the connection is short, temporary, and
    you have control over the computer used (for example, a setup port on
    a product, which is only use in the manufacturing process, would be a
    perfect application).

    Best regards,
    Spehro Pefhany
  10. Don Bowey

    Don Bowey Guest

    That agrees with ANSI/EIA/TIA 232-E-1991. It allows for + and - 3 to 15V.

    That depends on the receiver; some do, some don't. If it doesn't you can
    put a DC bias (negative with respect to ground, in your case) on the RD
    lead, so the the RD goes slightly neg when the +12 is not present. Uou may
    need to insert a few kOhms in series from the SD.

  11. linnix

    linnix Guest

    Relying on other signals are not as clean a solution, since some cables
    connect 3 pins (TX, RX and GND) only. Some circuits use the incoming
    RX off state (-3V to -12V) to store some charges and feed it back to TX
    via some transistors. It works as long as the local TX duty cycle is
    less than 50%.
  12. Well, since the OP is designing his circuit, this wouldn't be a problem,
    would it?
    And for the cables: even the cheap bulk $0.50 cables have all 9 pins

    Oh, and most important: I have actually used this setup many times and it
    *always* worked.

  13. budgie

    budgie Guest

    Tyhe spec requires that a receiver will respond correctly to signals in the +3v
    to (IIRC) +15v range as positive, and -3v to (IIRC again) -15V as negative.
    If you are talking Vce(sat) above ground then IMOextensiveE with RS232
    interfaces this will work on 99% of PC clones, ranging from those with 1488/1489
    chips to the latest LSI incarnations. As someone lese pointed out, most
    receivers seem to actually respond as TTL inputs (with clamping).

    Whether you have a +5V or +12V on the collector load is pretty much immaterial.

    It is certainly NOT a methodology recommended for production. For that I use
    dedicated MAX chips and generate a true bipolar swing, but for your own
    quick'n'dirty interface it'll should be fine.
  14. Don't count on it. However, many poorly-designed, non-spec-compliant
    interfaces will work with those voltages.


  15. I did not know that. Please provide a reference to a EUA-232 receiver with
    such a specification.
  16. And as long as the other end isn't trying the same cheap shortcut.
  17. Well Richard, you seem to have a lot to say to people on this subject,
    and with such authority, even though it's actually on topic :)

    The understanding of the spec is correct however the practice is
    different. Please tell me which common RS-232 receivers *require* a
    negative threshold (I know they exist, but where are they used). The
    reality is that the receivers just turn-on at around 1.5V. If you drive
    them with less than this they are turned-off (output high).

    So, for short runs, without serious noise or ground-loop problems the 0
    to +5V method will always work, not intermittently as you state, as if
    the thresholds actually vary constantly. Of course this is not within
    the EIA-232 spec born from it's archaic requirements, but it is within
    the chip spec and actual system parameters.

    BTW, I design production equipment with MAX232's but that is mainly for
    customer comfort so I can tell them it is "compliant". I don't get
    confused with the difference between compliance to a specification vs
    hardware design. It is my job to understand the hardware without being
    bamboozled by the hype. Remember Y2K?

  18. budgie

    budgie Guest

    Richard you are missing the point of the EIA spec. It mandates that compliant
    receivers must respond to voltages >+3V as high and to voltages below -3V as
    low. Any receiver with a threshold between these points will be compliant.

    As an example, have a look at the input circuit of the NatSemi:

    Care to tell us all that it is non-compliant?

    It has a positive threshold, with feedback. Care to tell us all that input
    transition from +5V to Vce(Sat) above ground (or vice versa) won't switch it?
  19. Mac

    Mac Guest

    Many well-designed ones will work, too. It's just not guaranteed by the
    spec to work.

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day