EINTR.net / serial

RS232 Electrical Principles

Knowing how RS232 works electricaly can be quite usefull when testing and debugging cables and serial ports with simple multi-meter or elaborate breakout box. Altough, I won't show you how you can do this.

I'm by far an expert on this. The information on this page can be wrong and it should only be considered an introduction to the subject, no more.

General Information

RS232 standard uses different voltage values to indicate state.

The "GROUND" pin is the reference used in mesuring the voltage on the other pins. For RS232 to work properly, it is important to connect both GROUND pin between devices.

Basicaly, there is 3 voltages state.

The unknown voltage state also include the disconnected serial port. It is there to make shure there is a clear separation between the positive and negative voltage state and that no confusion in detecting the current state can occur.

To simplifly things, the unkown voltage state can be consider equal as the negative voltage state for the purpose of choosing a meaning for both the data and control pins.

Data Pins

TD and RD

The data pins use a clocked +/- voltage pulse to send bits in a serialized way over a single wire. One wire in each data direction is needed.

Voltage Binary Value Name
-V 1 MARK
+V 0 SPACE

The serial link use in-band framing to separate individual bytes [which don't require to be 8 bits long]. So each byte sent is placed between a start bit (SPACE) and at least one stop bit (MARK) and when no data is sent, a continious stream of 1 (MARK) is sent.

Serial data diagram

This diagram attempts to show visualy how the serialized data stream looks. It may help to understand or not.

MARK=1 (-V DC) No data to send
[Continious stream of 1s]

Start bit
[0]

Byte
[variable]

Parity
[variable
optional]
Stop bit
[1
second optional]
Start bit
[0]

Next Byte


  1 1 1 0 0 1 ... 0 0 1 1 0 ...
SPACE=0 (+V DC)    
Lenght controlable:
CS6
CS7
CS8

Disabled:
-PARENB
Enabled:
PARENB
Even:
-PARODD
Odd:
PARODD

2nd Stop Bit Disabled:
-CSTOPB
2nd Stop Bit Enabled:
CSTOPB
   

Other serial data info

BREAK

A BREAK event is when a series of continious 0 (SPACE) is sent long enought so that the remote device detects a framing error because the stop bits are missing.

Control Pins

DCD, DTR, DSR, RTS, CTS and RNG

Controls pins use voltage to indicate their asserted (on) or off state. Unlike the data pins, there is no baud rate or framing to complicate things.

Voltage Meaning
+V ON, asserted
-V OFF

You may which to look at my serial link pin functions web page to see what each signal mean when it is asserted.


(c) 2002 Hugo Villeneuve
$Id: electrical_spec.html,v 1.5 2002/10/02 04:44:46 harpagon Exp $