Asynchronous communication--or transmission-- sends individual characters (one at a time) that are framed by a start bit and 1 or 2 stop bits.
Start / Stop bits
The purpose of the Start bit is to notify the receiving station of a new arriving character . Typically, data is shown moving from left to right. This is how it would appear on either a Storage Oscilloscope or a Network Analyzer. The MSB (Most Significant Bit) is sent first and the LSB (Least Significant Bit) is sent last.
The purpose of the Stop bits is to indicate the end of data. There could be 1or 2 stop bits, with 1 being the typical number of stop bits that were used today. In Asynchronous transmission, the characters are sent individually with a quiet period in between (quiet meaning 0 bit level). Asynchronous communications requires the transmitting station and the receiving station to have individual internal free-running clocks (operating at the same frequency). Free-running means that the clocks are not locked together.
Both clocks operating at same frequency:
The receive station starts checking for data after the Start bit is received (the Start bit is a wake up call!).
The receive station samples the transmitted data in the middle of each data bit. The samples are evenly spaced. They match the transmitted data because both transmit and receive clocks are operating at the same frequency.
Receive clock frequency higher than transmitted frequency:
If the receive station's clock is higher in frequency, the samples will be spaced closer together (higher frequency - shorter period). In the above example, we transmitted the following data: 0100 1010, but we received the data: 0100 0101. The samples are out of synchronization with the transmitting data. Therefore, we would have an error in receiving data.
Clocks are controlled by crystals (abbreviated: Xtal). Crystals are metal cans that hold a piezo-electric element. This element resonates at a certain frequency when a voltage is applied to it. If you drop a crystal or a printed circuit board (PCB) that has a crystal on it, the crystal can fracture inside of the metal can. Either it will stop working, or it will change its frequency: both result in a malfunctioning circuit! Crystals are also temperature-sensitive and change frequency with temperature!
Receive clock frequency lower than transmitted frequency:
If the receiving station's clock is lower in frequency than the transmitted frequency, then the samples become farther apart (lower frequency - wider period). Again, the samples become out of sync with the transmitted data!
The transmitted data is 0100 1010, but the receive data is 0101 0101! We would again have receive data errors.
This is a basic problem with asynchronous communications: both transmitter and receiver require a very stable clock to work properly. At high frequencies (which result in high transfer rates), clock stability is critical and asynchronous transmission is very difficult to accomplish. Because of this inherent problem with asynchronous transmission, it is used at low frequency/slow transfer rates.
7/8 Bit Codes
There are 2 common data transfer codes in data communication:
7 bit code (Text)
8 bit (Binary)
7 Bit Code or Text:
7 bit data code transfer is used to transfer text files. These are files consisting of ASCII text characters only. There are only 27 or 128 different characters in the ASCII text transfer type.
Usually, files that are meant to be read by the human eye used 7 bit code. Text editors like DOS's EDLIN & EDITOR, or Unix's pico or vi, are used to change or modify the files. Examples of text files are the following: autoexec.bat, config.sys, .signature, E-mail, stories, and information.
8 Bit Code or Binary:
8 bit code is used to transfer binary files that contain information that is to be "read" specifically by an application or microprocessor. They contain 8 bit (1 byte) control codes and have 28 or 256 different characters. Examples of binary files are: drawings.bmp (bit mapped graphics), win.com (application), and newtext.zip (compressed files).
Common Problems:
If you download a binary (8 bit) file, using text (7 bit) mode, you lose1 bit from each character. In a binary file, this is disastrous! The text transfer mode ignores the 8th bit and discards it into the bit bucket. In the following example, the number 202 is transmitted, but the number 74 is received. You end up with a corrupted file!
If you download a text file (7 bit) using binary (8 bit) mode, an extra bit is inserted into the data. The bit is set to 0 and placed as the MSB or 8th bit.
The received file works beautifully! If there is a choice, or you are not sure what the number of data bits are, always pick Binary (or 8 bit) transfer mode! Originally, when transfer rates were very slow (300 to 1200 bps), sending 7 or 8 bits would make a big difference in transfer time.
Parity Bits
In asynchronous communications, a simple error checking method called Parity Checking is used. There are 3 types of Parity Bits: Even, Odd and None. None means that there is no Parity Checking and the Parity Checking is disabled!
Even Parity Generation
Even Parity counts the number of 1s in the data to see if the total is an even number. If the number of 1s is an even number, then the Parity bit is set to 0. If the number of 1s is an odd number, the Parity bit is set to 1. This makes the total number of 1s an even number. The Even Parity Bit is used to make the total number of 1s equal to an even number.
| Data | Even Parity Bit | |
| 01001010 | 1 | 3 x 1s in Data: 3 is an odd number, Parity Bit = 1 |
| 01111110 | 0 | 6x 1s in Data: 6 is an even number, Parity Bit = 0 |
| 10101010 | ? | What should the parity bit be? |
Even Parity Checking
Even parity checking occurs when a data with even parity is received. The number of 1s in both the data and the parity bit are counted. If the number of 1s is an even number, then the data is good data; if it is an odd number, then the data is corrupted.
| Data | Even Parity Bit | |
| 01001010 | 1 | 4 x 1s in data and parity bit = Good data |
| 01111110 | 1 | 7 x 1s in data and parity bit = Bad data |
| 10101010 | 0 | Is this good or bad data? |
Odd Parity Generation
Odd Parity is the opposite of Even Parity. Odd Parity counts the number of 1s in the data to see if the total is an odd number. If the number of 1s is an odd number, then the Parity bit is set to 0. If the number of 1s is an even number, then the Parity bit is set to 1: this makes the total number of 1s an odd number. The Odd Parity Bit is used to make the total number of 1s equal to an odd number.
| Data | Odd Parity Bit | |
| 01001010 | 1 | 3 x 1s in Data: 3 is an odd number, Parity Bit = 0 |
| 01111110 | 0 | 6x 1s in Data: 6 is an even number, Parity Bit = 1 |
| 10101011 | ? | What should the parity bit be? |
Odd Parity Checking
Odd parity checking occurs when data with odd parity has been received. The number of 1s in both the data and the parity bit are counted. If the number of 1s is an odd number, then the data is good data; if it is an even number, then the data is corrupted.
| Data | Odd Parity Bit | |
| 01001010 | 0 | 3 x 1s in data and parity bit = Good data |
| 01111110 | 0 | 6 x 1s in data and parity bit = Bad data |
| 10101010 | 0 | Is this good or bad data? |
Parity Agreement
Both receive and transmit stations must agree on the type of parity checking that's used before transmitting. Usually, it is placed in the communications parameters setup. Most common transfer are as follows: 8n1 (8 data bits, no parity, 1 stop bit) or 7e2 (7 data bits, even parity, 2 stop bits).
The parity bit is added in the asynchronous bit stream just before the stop bits (and adds to the overhead for asynchronous transmission). A total of 12 bits must be transmitted in order to send 8 bits of data.
Problems with Parity Checking
There is a problem with parity checking. It works reliably if there is only 1 bit error in the transmitted character stream. If there are 2 bit errors, however, the parity checking may not detect that there is an error. For example:
| Data | Odd Parity Bit | ||
| Transmitted | 01001010 | 0 | 3 x 1s in data and parity bit = Good data |
| Received | 01101110 | 0 | 5 x 1s in data and parity bit = Good data? |
Parity checking would pass the received data as good data even though 2 bits are corrupted!
If this section was helpful, why not donate to further development?