EINTR.net / serial
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.
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.
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.
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.
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]
|SPACE=0 (+V DC)|
2nd Stop Bit Disabled:
2nd Stop Bit Enabled:
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.
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.
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 $