1
\$\begingroup\$

I'm writing a program in C to talk to a modem via an rs-232 serial port. Unix supports 6 pinouts in the serial line, including TXD (Transmitted Data), RXD (Received Data), DCD (Data Carrier Detect), DTR (Data Terminal Ready), CTS (Clear To Send), and RTS (Request to Send). Now according to the below documentation, RS-232 actually comes in 3 different flavors (A, B, and C) with each one defining a different voltage range for the on and off levels. The most commonly used variety is RS-232C, which defines a mark (on) bit as a voltage between -3V and -12V and a space (off) bit as a voltage between +3V and +12V

http://www.cmrr.umn.edu/~strupp/serial.html

Why is an on bit defined with a negative voltage and an off bit defined with a positive voltage? Shouldn't it be reversed?

\$\endgroup\$

migrated from superuser.com Feb 3 '14 at 7:13

This question came from our site for computer enthusiasts and power users.

  • \$\begingroup\$ Because it is 50 years old junk. There is no modern rationale for it. \$\endgroup\$ – Lundin Mar 25 '14 at 10:10
1
\$\begingroup\$

AFAIK the A, B and C standards are updates, they don't specify different voltage levels.

Why those strange, inverted levels? The RS232 electrical characteristics are VERY old, and were originally chosen to drive electromechanical terminals (teletypes). Those levels were appropriate for that technology.

After that, why change? For the same reason, we still have a keyboard layout that was designed to prevent fast typing...

\$\endgroup\$
0
\$\begingroup\$

In RS232 a valid "spacing" voltage (data bit 0) is +3 to +15 when connected and tolerant to +25 when open-circuit. The "marking" (data bit 1) voltage levels are -3 to -15 and -25. The drivers and receivers are tolerant of a short to another signal. The signal will not go through then, but the drivers & receivers should recover once the short is rectified. Suggested reference

Since -3 to +3 is signal's non-man land, many receivers use a biased mid-point away from 0.0V to 1) prevent a grounded input from chattering 2) or bias to a mid-point like +2.5V to allow 0 and 5 voltage signals.

RS232 also defines a maximum slew-rate (dV/dt) that is generally ignored else high baud values would not be allowed.

Agree with @Wouter van Ooijen. It worked then and many technologies are evolutionary - not revolutionary.


Some additional musings.
Some RS232 terms go way back to early telegraph.

The terms for signal condition of "Space" (Data bit 0) and "Mark" (data bit 1) denote when a paper tape was "marked" or not. Soon this was changed to audio signals instead.

RS232 "break" condition (All data bits 0 and stop bit 0) corresponds to a telegraph operator "breaking" the circuit. Back-in-the-day, all the operators, shared a signal wire. When not sending, they left the keypad in a closed position - creating an idle voltage. Any one operator signaled "break" to announce a following message. By then tapping on the keypad, the circuit momentarily created the dits and dahs of Morse code.

Moving forward with teletype, I suspect a dual +/- voltage was needed to drive the mechanisms closed and open. But the concept of a "break" to announce an incoming message persisted. (This does not address why it is +V means 0 and -V means 1 versus the other way around.)

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.