Lecture-66 Asynchronous Serial Data Communication A serial data signal is divided into time intervals called bit times as shown in fig.2.5. During each bit time interval (T B ), the signal is either a 0 or ; it can change logic levels only at the start of a new bit time interval. Serial Data 0 TB TB TB TB TB TB time Fig.2.5 Serial Data Line during Serial Communication The rate at which serial transmission takes place is called the Baud Rate. It is essentially equal to the number of bits of information that are transmitted per second. Since bit is transmitted for a time interval equal to bit time, T B, the baud rate is given by Baud Rate= Time = T B (s/ second) For example, in a teletypewriter (TTY) system, T B is 9.09 msec. This gives a baud rate of 0 bits/sec. Commonly used baud rates are 0, 50, 300, 600, 900,200, 2400, 4800, 9600,3.8k,4.4k,9.2k, 38.4k, 57.8k. When asynchronous serial data are transmitted between two devices such as CRT terminal & microprocessor, a standard format is used to transmit a single data character as shown in fig.2.6. This format consists of three or four parts:
) A START bit, which is always logic 0 called space. 2) Five to eight data bits, representing the actual information being transmitted. The LSB are normally transmitted first. 3) An optional priority bit for error detection capability. If the parity bit is included, either odd or even parity can be used. 4), ½ or 2 stop bits which are always s. ½ (one and half stop bits) would be represented as a level, which lasts for ½ bit time. Most frequently, there will be 2 STOP bits. Mark/ Idle State Serial Data 0 START (5 to8 data bits) D0 D D2 D3 D4 D5 D6 D7 Optinal Parity Stop (s) TB TB TB TB TB TB TB TB TB TB TB TB Fig.2.6 Serial Data Line to Transmit a during Asynchronous Serial Communication For a given system, the number of data bits, the optional parity bit and the number of STOP bits are fixed by the design. Fig.2.7 shows an example of a serial data word that uses 7 data bits, an even parity bit and 2 STOP bits. The 7 data bits are the ASCII code to time alpha numeric character K being transmitted. Mark/ Idle State Serial Data 0 START (7 data bits for character 'K') D0 D D2 D3 D4 D5 D6 Even Parity Two Stop (s) TB TB TB TB TB TB TB TB TB TB TB time Fig.2.7 Serial Data Line to Transmit K in Asynchronous Mode
The complete serial data word counting begins with a START bit of 0. The signal line is assumed to be transmitting a constant HIGH level prior to the START bit. This is called mark state or idle state. Whenever a data is not being transmitted, the signal line is always in mark state. Thus, the beginning of each data character is characterized by a to 0 transmission when the START bit occurs. Here the START bit is followed by 7 bits of data, beginning with LSB and ending with MSB. These the actual data being transmitted here are read as 00 0 which happens to be the ASCII code for K. The data bits are followed by an even parity bit; in this case it is 0. Since 7 data bits contain an even number of s. The parity bit is followed by 2 STOP bits, which are always s. Even though the receiver and transmitter in an asynchronous data transfer are not synchronized with respect to the time at which a character is transmitted, once the transmitter starts to send a character, the receiver synchronizes itself with the bit times of the character in order to sample them at the correct time. The baud rate of the transmitter & receiver are set to the same value. A start bit synchronizes transmitter and receiver. The receiver synchronizes its operation with the transmitter on the to 0 transition of the data line. It waits one half a bit time, checks the input to make sure it is still logic 0 and therefore a valid start bit - and begins sampling the data line at intervals equal to one bit time. The data line is sampled at the centre of each transmitted bit. This eliminates errors that might occurs if sampling takes place at the beginning of each bit time, since
the leading or trailing edges of the transmission on the data line are distorted in transmission. It then samples the parity bit & stop bits. The actual information, which the transmitter is sending to the receiver, is contained in the data bits. The data bits of each transmitted word are formed by the START & STOP bits. The receiver uses these framing bits as a means for determining which bits are the data bits. Synchronous Serial Data Transmission: Asynchronous serial data transmission in the most widely used type of serial communication. In this transmission each character needs start bit, 2 stops bit and may be one parity bit in addition to data bits to separate the characters. These extra bits increase the amount of time required to transmit a single character. Synchronous serial data communication does not use the extra START & STOP bits. Data words are transmitted continuously one after the other with no indication of character boundaries. The synchronization between the receiver and transmitting is accomplished by transmitting a special synchronizing word or character after a specific number of data words. The synchronizing character is an 8-bit character that would not normally appear in a stream of data words. A commonly used sync character is 00000 2 = 6 6 which is the ASCII code for the synchronizing character SYN. A typical synchronizing transmission sequence is shown in fig.2.8. DATA DATA DATA DATA Fig.2.8 Typical Sequence of Data Transmitted in Synchronous Mode
In case of asynchronous data communication, each character is transmitted in a frame with START and STOP bits but in synchronous communication there is no START or STOP bit. The information consisting of data or synchronizing characters are transmitted continually as a stream of logic and logic 0. In the beginning of data transmission, only synchronizing characters are transmitted and only after that the actual data transmission begins. Therefore, to synchronize the transmitter with the starting of a character, the receiver operates in a hunt mode. Initially all the bits of the data received are set. Then the data line is sampled and the received bit is put on MSB shifting rest of the bits towards right. The data so formed is compared with the synchronizing character. If the data is different than synchronizing character, the data line is again sampled and the new data is formed and compared with the synchronizing character. In this way, the receiver operated in hunt mode - making bit by bit comparison of the input stream with the value of the synchronizing character until it detects the synchronizing character. Once the desired character is detected, the receiver treats each subsequent group of n-bits as a character. The transmitter continues to send synchronizing characters to maintain the synchronization, even if the sources of data character do not have data ready for transmission. In this case the transmitter sends the synchronizing character continuously and thus the time interval between two characters is fixed. The clocks in the transmitter and receiver operate at exactly the same frequently and must be very stable to maintain synchronization for a long period of time. Typically, thousands of blocks if character can be sent without re-synchronizing the receiver.
In case of asynchronous communication, the data bits are sampled in the middle of the data bit to ensure that the data received is correct and this is implemented by giving a delay of T B /2 after the START pulse is detected. In case of synchronous communication, it is implemented with the help of common clock signal. The transmitted transmits the data bits on TxD line at the falling edge of clock signal and the receiver samples the RxD line on the rising edge of clock signal. Thus the data bits are sampled in the middle of each bit. In this case, the baud rate is same as the frequency of clock signal. It is possible sometimes that the special SYN character may be present in the data itself, thus making it difficult to differentiate data with the synchronizing character. In such cases, instead of single synchronizing character, two synchronizing characters SYN and SYN2, are transmitted together. The synchronization is also established when both the characters were detected together. Synchronous communication is typically used for high speed transfer of large block of data. This is because only 2% of the transmitted data is taken up by the synchronizing characters as compared to 20% for asynchronous communication.