Serial Communication Microprocessor and Interfacing by Ravinder Nath Rajotiya - May 21, 2021May 21, 20210 Share on Facebook Share Send email Mail Print Print Table of Contents Toggle Introduction to Serial CommunicationType of Serial commuication.Handshake signals in serial communicationsAn Example- Serial printersSerial TerminalsTypical Serial Interface device Introduction to Serial Communication There are two forms of transmission, these are Serial Communication Parallel Communication Serial Communication Parallel Communication Communication over a single wire Communication over multiple wires, generally over 8 wires to carry a byte of data Slower and cheap Faster but costlier Require Parallel to serial and serial to parallel conversion for transmitting and receiving of data No such conversion is required Baud rate: Baud rate plays an important rle in the communication of serial data. This is the rate at which serial data is transferred. Its unit is bits/sec. Baud rate=1/(time between signal transitions). Example-1 is the signal is changing every 6.3ms, then baud rate= 1/(6.3×10-3)=600bd. Example-2: each character contains a start bit, 7 information bits, a parity bit, one stop bit making a total of 10 bit per character. Let the baud rate of line is 1200 baud, i. Asynchronous line would then transmit a max 1200/10 = 120 no. of chatacters per seconds . maximum rate could be achieved if there were no dead time between the characters. ii. A synchronous line without parity bit operating at 1200 baud could transmit four synch charater and a 100 character message in: 7(100+4) 1200 = 0.60677 seconds or roughly 12000.6067 = 165 characters per seconds Common baud rates are 300,600,1200,2400, 3600, 480, 9600, 11200, 19200 Mode of Transmission: Communivation mode are of the following types: Simplex Mode Duplex Mode Simplex mode: Communication which is one way or unidirectional. Brodcasting, telecasting re examples of this type. Half duplex : Half duplex uses one wire for communication. Communication can be both way but one way at a time, i.e. a station can only receive or transmit at one time. A printer would for example need half duplex type communication. A character is displayed on the terminal at the same time as it is types, no echo is used to display. When the computer is receiving, it cannot send/transmit, the communication link must be turned around for that purpose. Figure shows the haf duplex system of cmmunication with a computer. Full duplex: Communication can happer both way simultaneously. It uses two wires one for receiving and another for transmitting. Terminals and serial devices connected to a computer using full duplex send the character to the computer without displying it. The computer immediately sends back echos the character which is displayed on terminal. Figure below shows the full duplex system. As the echoed character can be sent at the same time a new character is being input, there is no loss of time. Type of Serial commuication. There are basically two types of serial communication. These are: Asynchronous serial communicationsSynchronous serial communication. The difference between them are: Asynchronous Serial Communication Synchronous Serial Communication No requirement of the external clock signal External clock signal i required mostly in long distance applications and are a perfect fit for the stable communication mostly in short distance applications The data transmission becomes slower The data transmission becomes faster with same bus to share clock and data Mismatch in baud rate in this interface may happen as baud rate is required to be set for both end systems there is no mismatch in baud rate in this interface In asynchronous Serial Interface the absence of external Clock Source makes it rely on several parameters such as Data Flow Control, Error Control, Baud Rate Control there is a shift of the data onto serial line providing the clock as a separate signal as there is no start, stop and parity bits are added to data. DATA is sent in FRAMES DATA is sent in block at constant rate Protocol examples are RS-232, RS-422 and RS-485. Protocol examples are I2C and SPI. Handshake signals in serial communications RTS and CTS are the most common handshake signals. A DTE device asserts the “request to send” (RTS) signal when it is ready to receive data and deasserts it when it cannot accept data. Likewise, a DCE device asserts “clear to send” (CTS) when it is ready to receive data. The RTS and CTS signals form a handshaking pair, and their use constitutes RTS/CTS handshaking. The “data terminal ready” (DTR) signal, asserted by the DTE, and the “data set ready” (DSR) signal, asserted by the DCE, serve similar functions and constitute DTR/DSR handshaking. A DTE or DCE devices may employ either or both forms of handshaking. Often, deasserting RTS or CTS signals “micro” events, such as a buffer that is full but will be empty soon, while deasserting DTR or DSR may signal “major” events such as that power has not been applied. An Example- Serial printers Ref: https://www.qnx.com/developers/docs/qnx_4.25_docs/qnx4/user_guide/chardev.html Serial printers are usually bidirectional devices. Data flows from computer to printer as expected, but since printers can’t keep up with the host computer, serial printers often use software flow control to regulate the flow of data. In other words, they transmit XON and XOFF characters back to the computer. Some printers use the hardware handshaking lines for this purpose, some support both forms of flow control. To be safe, you should connect all nine signals, although printers that support only software flow control may function just as well with a three-wire cable (Rx, Tx, and Gnd). Also, since printers are usually configured as Data Terminal Equipment (DTE) — just like the host computer — you may need to use a null-modem cable. Serial Terminals Ref: https://www.qnx.com/developers/docs/qnx_4.25_docs/qnx4/user_guide/chardev.html Terminals operate with or without flow control and at a fixed baud rate. Unlike printers, terminals can usually keep up with the host computer at a supported baud rate. A simple three-wire cable may be sufficient, but we recommend a nine-wire cable. Like the host computer, terminals are normally configured as DTE devices, so a null-modem cable is usuay required. If your terminal supports software flow control (e.g. VT100), it’s a good idea to enable output software flow control and lock it on. Typical Serial Interface device Figure shows a typical serial interface. It receives the data over its serial input single bit at a time. The bits are packed in bytes by using a serial-parallel data-in-shift register. For transmission, the bytes of data is converted into a serial form by using a data-out shift register. There are four ports two of which are read only and the other two are writable. These are Read ports: Status register, data-in-buffer registering Write ports: Command register, and data-out buffer registers. An address line such as A0 which cna be connected to one of the address line is used to select one from each of the above two combination. Share on Facebook Share Send email Mail Print Print