Synchronous and Asynchronous Transmission
One of the main problems when two devices linked by a transmission medium wish to exchange data is that of synchronising the receiving device with the transmitting device. Typically, data is transmitted one bit at a time, and the data rate must be the same for both the transmitter and the receiver. The receiver must be able to recognise the beginning and end of a block of bits, and know the time taken to transmit each bit, so that it can sample the line at the correct time to read each bit. When the sending device is transmitting a stream of bits, it uses an internal clock to control timing. If data is transmitted at 10 Kbps, a bit is transmitted every 0.1 milliseconds. The receiver attempts to sample the line at the centre of each bit time, i.e. at intervals of 0.1 milliseconds. If the receiver uses its own internal clock for timing, a problem will arise if the clocks in the transmitter and receiver are not synchronised. A drift of 1 percent will cause the first sample to be 0.01 of a bit time away from the centre of the bit, so that after fifty or more samples, the receiver may be sampling at the wrong bit time. The smaller the timing difference, the later the error will occur, but if the transmitter sends a sufficiently long stream of bits, the transmitter and receiver will eventually be out of step. Two approaches exist to solve the problem of synchronisation - asynchronous transmission and synchronous transmission.
Timing problems are avoided by simply not sending long streams of bits. Data is transmitted one character (byte) at a time. Synchronisation only needs to be maintained within each character, because the receiver can resynchronise at the beginning of each new character. When no characters are being transmitted, the line is idle (usually represented by a constant negative voltage). The beginning of a character is signalled by a start bit (usually a positive voltage), allowing the receiver to synchronised its clock with that of the transmitter. The rest of the bits that make up the character follow the start bit, and the last element transmitted is a stop bit that is typically 1.5 or 2 times as long as the other bits transmitted. The transmitter then transmits the idle signal (which is usually the same voltage as the stop bit) until it is ready to send the next character (see below).
Character format in asynchronous transmission
Asynchronous transmission is also known as start-stop mode or character mode. Each character is framed as an independent unit of data that may be transmitted and received independently. Data may also be transmitted as a continuous stream of characters. Most communications systems require a specific number of bits to represent each character, plus a parity bit that is often included to provide simple error detection. Asynchronous data characters normally contain 8 data bits (including the parity bit) plus a start bit and at least 1 stop bit, giving a total of 10 bits. Data can be transmitted in blocks of characters known as transmission blocks. The transmission block may use special control characters to provide control functions and to identify the start and end of a block. Asynchronous transmission is only really suitable for relatively low data rates (up to 3 Kbits). Many of the bits transmitted in each block are control bits, giving a high proportion of overhead. It is used mainly for applications where character data is generated at irregular intervals (e.g. user input from a keyboard).
With synchronous transmission, the receiver's clock is synchronised with the transmitter's clock. Data is transmitted in a continuous stream, and the arrival time of each can be predicted by the receiver. This is achieved either by using a separate timing circuit, or by embedding the timing information in the signal itself. The latter can be achieved using bi-phase encoding (e.g. Manchester encoding). An embedded timing signal can be used by the receiver to synchronise with the transmitter using a Digital Phase-Locked Loop (DPLL).
Use of embedded timing information
A data frame usually starts with one or more bytes of data that have a unique bit pattern, or flag (sometimes called a preamble), that tells the receiver a block of data will follow. The preamble is followed by various control fields, a variable-length data field, more control fields, and finally a postamble. The control information within the frame will include a length field, which specifies the amount of data to be read.
A bit-oriented frame
For large blocks of data, synchronous transmission is far more efficient than asynchronous transmission, requiring far less overhead. The accuracy of the timing information allows much higher data rates. There is usually a minimum frame length, and each frame will contain the same amount of control information regardless of the amount of data in the frame.