0% found this document useful (0 votes)
35 views12 pages

Serial Data Transfer Schemes 1 12

Uploaded by

Saumya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views12 pages

Serial Data Transfer Schemes 1 12

Uploaded by

Saumya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Microprocessors and Microcontrollers P age |1

UNIT-5
SERIAL DATA TRANSFER SCHEMES

SERIAL COMMUNICATION

INTRODUCTION

Serial communication is common method of transmitting data between a computer and a peripheral
device such as a programmable instrument or even another computer. Serial communication transmits
data one bit at a time, sequentially, over a single communication line to a receiver. Serial is also a most
popular communication protocol that is used by many devices for instrumentation. This method is used
when data transfer rates are very low or the data must be transferred over long distances and also where
the cost of cable and synchronization difficulties makes parallel communication impractical. Serial
communication is popular because most computers have one or more serial ports, so no extra hardware is
needed other than a cable to connect the instrument to the computer or two computers together.

SERIAL AND PARALLEL TRANSMISSION

Let us now try to have a comparative study on parallel and serial communications to understand the
differences and advantages & disadvantages of both in detail.

We know that parallel ports are typically used to connect a PC to a printer and are rarely used for other
connections. A parallel port sends and receives data eight bits at a time over eight separate wires or lines.
This allows data to be transferred very quickly. However, the setup looks more bulky because of the
number of individual wires it must contain. But, in the case of a serial communication, as stated earlier, a
serial port sends and receives data, one bit at a time over one wire. While it takes eight times as long to
transfer each byte of data this way, only a few wires are required. Although this is slower than parallel
communication, which allows the transmission of an entire byte at once, it is simpler and can be used over
longer distances. So, at first sight it would seem that a serial link must be inferior to a parallel one, because
it can transmit less data on each clock tick. However, it is often the case that, in modern technology, serial
links can be clocked considerably faster than parallel links, and achieves a higher data rate.

Even in shorter distance communications, serial computer buses are becoming more common because of a
tipping point where the disadvantages of parallel busses (clock skew, interconnect density) outweigh their
advantage of simplicity. The serial port on your PC is a full-duplex device meaning that it can send and
receive data at the same time. In order to be able to do this, it uses separate lines for transmitting and
receivingdata.

K SUDHAKAR Unit-5
Microprocessors and Microcontrollers P age |2

From the above discussion we could understand that serial communications have many advantages over
parallel one like:

 Requires fewer interconnecting cables and hence occupies less space.


 "Cross talk" is less of an issue, because there are fewer conductors compared to that of
parallel communication cables.
 Many IC s and peripheral devices have serial interfaces.
 Clock skew between different channels is not an issue.
 Cheaper to implement.

Clock skew:
Clock skew is a phenomenon in synchronous circuits in which the clock signal sent from the clock circuit
arrives at different components at different times, which can be caused by many things, like:

 Wire-interconnect length
 Temperature variations
 Variation in intermediate devices
 capacitive coupling
 Material imperfections

SERIAL DATA TRANSMISSION MODES

When data is transmitted between two pieces of equipment, three communication modes of operation
can be used.

Simplex: In a simple connection, data is transmitted in one direction only. For example, from a computer
to printer that cannot send status signals back to the computer.

Half-duplex: In a half-duplex connection, two-way transfer of data is possible, but only in one direction at a
time.

Full duplex: In a full-duplex configuration, both ends can send and receive data simultaneously, which
technique is common in our PCs.

SERIAL DATA TRANSFER SCHEMS

Like any data transfer methods, Serial Communication also requires coordination between the sender and
receiver. For example, when to start the transmission and when to end it, when one particular bit or byte
ends and another begins, when the receiver's capacity has been exceeded, and so on. Here comes the
need for synchronization between the sender and the receiver. A protocol defines the specific methods of
coordinating transmission between a sender and receiver. For example a serial data signal between two
PCs must have individual bits and bytes that the receiving PC can distinguish. If it doesn't, then the
receiving PC can't tell where one byte ends and the next one begin or where one bit ends and begins. So
the signal must be synchronized in such a way that the receiver can distinguish the bits and bytes as the
transmitter intends them to be distinguished.

There are two ways to synchronize the two ends of the communication.
1. Synchronous data transmission
2. Asynchronous data transmission

K SUDHAKAR Unit-5
Microprocessors and Microcontrollers P age |3

Synchronous Data Transmission

The synchronous signaling methods use two different signals. A pulse on one signal line indicates when
another bit of information is ready on the other signal line.

In synchronous transmission, the stream of data to be transferred is encoded and sent on one line, and a
periodic pulse of voltage which is often called the "clock" is put on another line, that tells the receiver
about the beginning and the ending of each bit.

Advantages: The only advantage of synchronous data transfer is the Lower overhead and thus, greater
throughput, compared to asynchronous one.
Disadvantages:
 Slightly more complex
 Hardware is more expensive

Asynchronous data transmission

The asynchronous signaling methods use only one signal. The receiver uses transitions on that signal to
figure out the transmitter bit rate (known as auto baud) and timing. A pulse from the local clock indicates
when another bit is ready. That means synchronous transmissions use an external clock, while
asynchronous transmissions are use special signals along the transmission medium. Asynchronous
communication is the commonly prevailing communication method in the personal computer industry,
due to the reason that it is easier to implement and has the unique advantage that bytes can be sent
whenever they are ready, a no need to wait for blocks of data to accumulate.

K SUDHAKAR Unit-5
Microprocessors and Microcontrollers P age |4

Advantages:

 Simple and doesn't require much synchronization on both communication sides.


 The timing is not as critical as for synchronous transmission; therefore hardware can be
made cheaper.
 Set-up is very fast, so well suited for applications where messages are generated at
irregular intervals, for example data entry from the keyboard.

Disadvantages: One of the main disadvantages of asynchronous technique is the large relative overhead,
where a high proportion of the transmitted bits are uniquely for control purposes and thus carry no useful
information.

8251A-PROGRAMMABLE COMMUNICATION INTERFACE


(8251A-USART-Universal Synchronous/Asynchronous Receiver/Transmitter)

INTRODUCTION

A USART is also called a programmable communications interface (PCI). When information is to be sent by
8086 over long distances, it is economical to send it on a single line. The 8086 has to convert parallel data
to serial data and then output it. Thus lot of microprocessor time is required for such a conversion.
Similarly, if 8086 receives serial data over long distances, the 8086 has to internally convert this into
parallel data before processing it. Again, lot of time is required for such a conversion. The 8086 can
delegate the job of conversion from serial to parallel and vice versa to the 8251A USART used in the
system.
The Intel8251A is the industry standard Universal Synchronous/Asynchronous Receiver/Transmitter
(USART), designed for data communications with Intel microprocessor families such as 8080, 85, 86 and
88. The 8251A converts the parallel data received from the processor on the D 7-0 data pins into serial data,
and transmits it on TxD (transmit data) output pin of 8251A. Similarly, it converts the serial data received
on RxD (receive data) input into parallel data, and the processor reads it using the data pins D 7-0.

K SUDHAKAR Unit-5
Microprocessors and Microcontrollers P age |5

FEATURES

 Compatible with extended range of Intel microprocessors.


 It provides both synchronous and asynchronous data transmission.
 Synchronous 5-8 bit characters.
 Asynchronous 5-8 bit characters.
 It has full duplex, double buffered transmitter and receiver.
 Detects the errors-parity, overrun and framing errors.
 All inputs and outputs are TTL compatible.
 Available in 28-pin DIP package.

ARCHITECTURE

The 8251A is a USART (Universal Synchronous Asynchronous Receiver Transmitter) for serial data
communication. As a peripheral device of a microcomputer system, the 8251 receives parallel data from
the CPU and transmits serial data after conversion. This device also receives serial data from the outside
and transmits parallel data to the CPU after conversion. The internal block diagram of 8251A is shown in fig
below.

K SUDHAKAR Unit-5
Microprocessors and Microcontrollers P age |6

Data Bus Buffer: This bidirectional, 8-bit buffer used to interface the 8251A to the system data bus and
also used to read or write status, command word or data from or to the 8251A.

Read/Write control logic: The Read/Write Control logic interfaces the 8251A with microprocessor,
determines the functions of the 8251A according to the control word written into its control register and
monitors the data flow. This section has three registers and they are control register, status register and
data buffer.

 The active low signals 𝑅𝐷, 𝑊𝑅 , 𝐶𝑆 and 𝐶/𝐷 are used for read/write operations with these
three registers.
 When𝐶/𝐷) is high, the control register is selected for writing control word or reading status
word. When 𝐶/𝐷 is low, the data buffer is selected for read/write operation.
 When the reset is high, it forces 8251A into the idle mode.
 The clock input is necessary for 8251A for communication with microprocessor and this
clock does not control either the serial transmission or the reception rate.

Transmitter section: The transmitter section accepts parallel data from microprocessor and converts them
into serial data. The transmitter section is double buffered, i.e., it has a buffer register to hold an 8-bit
parallel data and another register called output register to convert the parallel data into serial bits. When
output register is empty, the data is transferred from buffer to output register. Now the processor can
again load another data in buffer register.
 If buffer register is empty, then TxRDY is goes to high.
 If output register is empty then TxEMPTY goes to high.
 The clock signal 𝑇𝑥𝐶 controls the rate at which the bits are transmitted by the USART.
 The clock frequency can be 1,16 or 64 times the baud rate.

Receiver Section: The receiver section accepts serial data and convert them into parallel data. The receiver
section is double buffered, i.e., it has an input register to receive serial data and convert to parallel, and a
buffer register to hold the parallel data. When the RxD line goes low, the control logic assumes it as a
START bit, waits for half a bit time and samples the line again. If the line is still low, then the input register
accepts the following bits, forms a character and loads it into the buffer register. The microprocessor reads
the parallel data from the buffer register.
 When the input register loads a parallel data to buffer register, the RxRDY line goes high.
 The clock signal 𝑅𝑥𝐶 controls the rate at which bits are received by the USART.
 During asynchronous mode, the signal SYNDET/BRKDET will indicate the break in the data
transmission. During synchronous mode, the signal SYNDET/BRKDET will indicate the
reception of synchronous character.

MODEM Control: The MODEM control unit allows to interface a MODEM to 8251A and to establish data
communication through MODEM over telephone lines. This unit takes care of handshake signals for
MODEM interface.

K SUDHAKAR Unit-5
Microprocessors and Microcontrollers P age |7

PIN DIAGRAM

Vcc: +5V supply


GND: Ground
D7-D0: This is bidirectional data bus which receives control words and transmits data from the
microprocessor and sends status words and received data to microprocessor.
𝑪𝑺: When signal goes low, the 8251A is selected by the MPU for communication.
𝑹𝑫: When signal goes low, the MPU either reads a status from the status register or accepts data from
data buffer.
𝑾𝑹: When signal is low, the MPU either writes in the control register or sends output to the data buffer.
C/𝑫: This is an input terminal which receives a signal for selecting data or command words and status
words when the 8251 is accessed by the microprocessor. If C/D = low, data will be accessed. If C/D = high,
command word or status word will be accessed.
RESET: A high on this signal reset 8252A & forces it into the idle mode.
CLK: Clock input, usually connected to the system clock for communication with the microprocessor.
𝑻𝒙𝑪: This is a clock input signal which determines the transfer speed of transmitted data. In "synchronous
mode," the baud rate will be the same as the frequency of TXC. In "asynchronous mode", it is possible to
select the baud rate factor by mode instruction. It can be 1, 1/16 or 1/64 the TXC.
𝑹𝒙𝑪: This is a clock input signal which determines the transfer speed of received data. In "synchronous
mode," the baud rate is the same as the frequency of RXC. In "asynchronous mode," it is possible to select
the baud rate factor by mode instruction. It can be 1, 1/16, 1/64 the RXC.

K SUDHAKAR Unit-5
Microprocessors and Microcontrollers P age |8

TxD- Transmitted Data Output: Output signal to transmit the data to peripherals
TxRDY: This is an output terminal which indicates that the 8251is ready to accept a transmitted data
character.
TxEMPTY: This is an output terminal which indicates that the 8251 has transmitted all the characters and
had no data character.
RxD- Receive Data Input: Bits are received serially on this line.
RxRDY: This is a terminal which indicates that the 8251 contains a character that is ready to READ.
SYNNDET/BD: This is a terminal whose function changes according to mode. In "internal synchronous
mode." this terminal is at high level, if sync characters are received and synchronized. If a status word is
read, the terminal will be reset. In "external synchronous mode, "this is an input terminal. A "High" on this
input forces the 8251 to start receiving data characters. In "asynchronous mode," this is an output terminal
which generates "high level"output upon the detection of a "break" character if receiver data contains a
"low-level" space between the stop bits of two continuous characters.
𝑫𝑺𝑹 - Data Set Ready: Checks if the Data Set is ready when communicating with a modem.
𝑫𝑻𝑹 - Data Terminal Ready: Indicates that the device is ready to accept data when the 8251 is
communicating with a modem.
𝑪𝑻𝑺 - Clear to Send: If it’s low, the 8251A is enabled to transmit the serial data provided the enable bit in
the command byte is set to ‘1’.
𝑹𝑻𝑺 - Request to Send Data: Low signal indicates the modem that the receiver is ready to receive a data
byte from the modem.

8251A USART INTERFACING WITH 8086

K SUDHAKAR Unit-5
Microprocessors and Microcontrollers P age |9

PROGRAMMING THE 8251A

Prior to starting a data transmission or reception, the 8251A must be loaded with a set of control words
generated by the microprocessor. These control signals define the complete functional definition of the
8251A and must immediately follow a reset operation (internal or external). The control words are split
into two formats.

1. Mode instruction
2. Command instruction

Mode instruction: Mode instruction is used for setting the function of the 8251A. Mode instruction will be
in "wait for write" at either internal reset or external reset. That is, the writing of a control word after
resetting will be recognized as a "mode instruction."
Items set by mode instruction are as follows:
• Synchronous/asynchronous mode
• Stop bit length (asynchronous mode)
• Character length
• Parity bit
• Baud rate factor (asynchronous mode)
• Internal/external synchronization (synchronous mode)
• Number of synchronous characters (Synchronous mode)
The bit configuration of mode instruction format is shown in Figures below. In the case of synchronous
mode, it is necessary to write one-or two byte sync characters. If sync characters were written, a function
will be set because the writing of sync characters constitutes part of mode instruction.

Fig. Mode instruction format, Asynchronous mode

K SUDHAKAR Unit-5
Microprocessors and Microcontrollers P a g e | 10

Fig. Mode instruction format, Synchronous mode

Command Instruction: Command is used for setting the operation of the 8251. It is possible to write a
command whenever necessary after writing a mode instruction and sync characters.

Items to be set by command are as follows:


• Transmit Enable/Disable
• Receive Enable/Disable
• DTR, RTS Output of data.
• Resetting of error flag.
• Sending to break characters
• Internal resetting
• Hunt mode (synchronous mode)

K SUDHAKAR Unit-5
Microprocessors and Microcontrollers P a g e | 11

Fig. Command instruction format

K SUDHAKAR Unit-5
Microprocessors and Microcontrollers P a g e | 12

Status Word: It is possible to see the internal status of the 8251 by reading a status word. The format of
status word is shown below.

Fig. Status word

K SUDHAKAR Unit-5

You might also like