Figure 1 - Asynchronous Data Transmission
The optional parity bit is a simple sum of the data bits indicating whether or not the data contains an even or odd number of 1 bits. With
even parity, the parity bit is 0 if there is an even number of 1's in the character. With odd parity, the parity bit is 0 if there is an odd
number of 1's in the data. You may also hear the terms space parity, mark parity, and no parity. Space parity means that the parity bit is
always 0, while mark parity means the bit is always 1. No parity means that no parity bit is present or transmitted.
The remaining bits are called stop bits. There can be 1, 1.5, or 2 stop bits between characters and they always have a value of 1. Stop bits
traditionally were used to give the computer time to process the previous character, but now only serve to synchronize the receiving
computer to the incoming characters.
Asynchronous data formats are usually expressed as "8N1", "7E1", and so forth. These stand for "8 data bits, no parity, 1 stop bit" and "7
data bits, even parity, 1 stop bit" respectively.
Full duplex means that the computer can send and receive data simultaneously - there are two separate data channels (one coming in,
one going out).
Half duplex means that the computer cannot send or receive data at the same time. Usually this means there is only a single data channel
to talk over. This does not mean that any of the RS-232 signals are not used. Rather, it usually means that the communications link uses
some standard other than RS-232 that does not support full duplex operation.
It is often necessary to regulate the flow of data when transferring data between two serial interfaces. This can be due to limitations in an
intermediate serial communications link, one of the serial interfaces, or some storage media. Two methods are commonly used for
asynchronous data.
The first method is often called "software" flow control and uses special characters to start (XON or DC1, 021 octal) or stop (XOFF or
DC3, 023 octal) the flow of data. These characters are defined in the
American Standard Code for Information Interchange ("ASCII").
While these codes are useful when transferring textual information, they cannot be used when transferring other types of information
without special programming.
The second method is called "hardware" flow control and uses the RS-232 CTS and RTS signals instead of special characters. The
receiver sets CTS to the space voltage when it is ready to receive more data and to the mark voltage when it is not ready. Likewise, the
sender sets RTS to the space voltage when it is ready to send more data. Because hardware flow control uses a separate set of signals, it
is much faster than software flow control which needs to send or receive multiple bits of information to do the same thing. CTS/RTS
flow control is not supported by all hardware or operating systems.
Serial
Programming
Guide
for
POSIX
Operating
Systems https://www.cmrr.umn.edu/~strupp/serial.html#CONTENTS
第5页 共26页