31
10.10 SERIAL COMMUNICATION INTERFACE Serial Communication Port: I/O interface, used to connect peripheral units, such as CRT terminals, modems, and printers, to a microcomputer. mits data to be transferred between two units using just two data li One line is used for transmitting data and the other for receiving data. Types of serial data communications. Synchronous communications. Asynchronous communications.

8251 UART

Embed Size (px)

DESCRIPTION

I/O interfacing circuits –Hand shaking,serial and parallel interfacing- Address decoding Interfacing chipsProgrammable peripheral interfacing (8255)- Programmable communication interface (8251)- Programmable timer(8253) - DMA controller(8237/8257)- Programmable interrupt controller(8259)- Keyboard display interface(8279)

Citation preview

Page 1: 8251 UART

10.10 SERIAL COMMUNICATION INTERFACE

Serial Communication Port: I/O interface, used to connect peripheral units, such as CRT terminals, modems, and printers, to a microcomputer.

It permits data to be transferred between two units using just two data lines

One line is used for transmitting data and the other for receiving data.

Types of serial data communications.

Synchronous communications.

Asynchronous communications.

Page 2: 8251 UART

The receiver and transmitter sections of the two pieces of equipment communicating with each other must run synchronously.

To initiate synchronous transmission, the transmitter first sends out synchronization characters to the receiver.

Synchronous communications

The receiver reads the synchronization bit pattern and compares it to a known sync pattern. Once they are identified as being the same, the receiver begins to read character data off the data line.

Transfer of data continues until the complete block of data is received.

If large blocks of data are being sent, the synchronization characters may be periodically resent to assure that synchronization is maintained.

Used in applications where high speed data transfer is required.

Page 3: 8251 UART

Asynchronous communications

The asynchronous method of communication eliminates the need for the Clock signal.

The simplest form of an asynchronous communication interface could consist of a Receive data, Transmit data, and Signal common communication line.

The data to be transmitted are sent out one character at a time, and at the receiver examining synchronization bits that are included at the beginning and end of each character performs end of the communication line synchronization.

The synchronization bit at the beginning of the character is called the Start bit, and that at the end of the character the stop bit.

7-bit ASCII can be used and parity added as an eighth bit for higher reliability in transmission.

Depending on the communications scheme, 1, 1.5, or 2 stop bits can be used.

The bits of the character are embedded between the start and stop bits.

Page 4: 8251 UART

Simplex, Half-Duplex, and Full-Duplex Communication Links

Page 5: 8251 UART

Baud Rate and the Baud-Rate Generator

Baud rate: The rate at which data transfers take place over the receive and transmit lines.

By baud rate we mean the number of bits of data transferred per second.

some of the common data transfer rates 300 bps1200 bps9600 bps

Baud rate is set by a part of the serial communication interface called theBaud rate generator.

The baud rate at which data are transferred determines the bit time, that is, the amount of time each bit of data is on the communication line. At 300 baud rate, the bit time is found to be 3.33 ms.

Page 6: 8251 UART

The RS-232C Interface

Electronic Industries Association (EIA) defines the pin definitions and electrical characteristics of this interfaces.

is a standard hardware interface for implementing asynchronous serial data communication ports on devices such as printer,CRT terminal, keyboards, and modem.

In large systems it is common to have the microcomputer part of the system in a separate room from the terminals and printers.

This leads us to the main advantage of using a serial interface to connect peripherals to a microcomputer, which is that as few as three signal lines can be used to connect the peripheral to the MPU. a receive-data lin e, a transmit-data line. and signal common.

This result in a large saving in wiring costs, and the small number of lines that need to be put in place also leads to higher reliability.

Page 7: 8251 UART

The RS-232C Interface

Page 8: 8251 UART

Data Terminal Equipment (DTE) & Data Communications Equipment (DCE)

How the signals of the RS-232C interface are used in a device depends on whether it is configured as DTE or DCE.

The direction for signals in a DTE and a DCE device are reversed.

That is, signal Lines that are outputs on a DTE device are inputs on a DCE and vice versa.

For instance, if pin 2 on a DTE is an output, it connects directly to pin 2 on the DCE, which acts as an input.

when both devices are configured as DTEs, the data transmitted by one is received by the other and vice versa.

Page 9: 8251 UART

Cont.

Page 10: 8251 UART

The control pins are provided to set up a handshake sequence for initiating communication between serial devices, like request to send (RTS).

In many systems only three signals TxD, RxD. and common are used to provide serial communication. In such a set up no handshakes sequences used to initiate communication.

The RS-232C interface is specified to operate correctly over a distance of up to 100 feet

To satisfy this distances specification, bus driver is used on the transmit line and a bus receiver is used on the receive line.

Cont.

These buffers do both the voltage level translation needed to convert the TTL compatible signals to the mark (logic 1) and space (logic 0) voltage levels defined for the RS-232C interface

Page 11: 8251 UART

10.11 PROGMMMABLE COMMUNICATION INTERFACE CONTROLLERS

The functions of RS-232 are normally implemented with a programmable communication controller known as Universal synchronous/asynchronous receiver transmitter (USART).

The programmability of the USART provides for a very flexible asynchronous communication interface.

Typically. it contains a full-duplex receiver and transmitter which can be configured through software.

Character lengths between 5 and 8 bits.

even or odd parity

with 1, 1.5, or 2 stop bits

has the ability to automatically check characters during data reception todetect the occurrence of parity, framing, and overrun errors.

Page 12: 8251 UART

8251A USART

Includes four key sections:

the bus interface section, which consists of the data bus buffer and read/write control logic blocks.

the transmit section, which consists of the transmit buffer and transmit control block.

the receive section, which consists of the receive buffer and receive control block.

the modem-control section.

Page 13: 8251 UART
Page 14: 8251 UART
Page 15: 8251 UART
Page 16: 8251 UART

The receiver section

Is responsible for reading the serial bit stream of data at the RxD (receive data) input and converting it to parallel form.

When a mark voltage level is detected on this line, indicating a start bit, the receiver enables a counter

As the counter increments to a value equal to one-half a bit time, the logic level at the RxD line is sampled again.

If it is still at the mark level, a valid start pulse has been detected.

Then RxD is examined every time the counter increments through another bit time.

This continues until a complete character is assembled and the stop bit is read.

After this, the complete character is transferred into the receive-data register.

Page 17: 8251 UART

During reception of a character

the receiver automatically checks the character data for parity, framing, or overrun errors.

If one of these conditions occurs, it is flagged by setting a bit in the status register.

Then the RxRDy (receiver ready) output is switched to the 1 logic level.

This signal is sent to the microprocessor to tell it that a character is available and should be read from the receive-data register.

RxRDy is automatically reset to logic 0 when the MPU reads the contents of the receive_data register.

Through software, the 8251A can be set up to internally divide theClock signal input at Rxc by 1, 16, or 64 to obtain the desired baud rate.

Page 18: 8251 UART

The transmitter section

does the opposite of the receiver section.

It receives parallel character data from the MPU over the data bus.

The character is then automatically framed with the start bit, appropriate parity bit and the correct number of stop bits and put into the transmit-data buffer register.

Then, the serial output on the TxD line will be sent.

The TxRDY output switches to logic 1, This signal can be returned to the MPU to tell it that another character should be output to the transmitter section.

In most applications, the transmitter receiver operate on the same baud rate. Therefore, the same baud-rate generator supplies both Rxc and Txc.

Page 19: 8251 UART

Receiver and transmitter driven at the same baud rate.

Page 20: 8251 UART

Configuration of 8251A

8251 can be configured for various modes of operation through software.

mode-control registercommand registerstatus register.

It has three internal control registers:

Page 21: 8251 UART

Mode instructionFormat.

configuration for asynchronous communications

Page 22: 8251 UART

Command instructionFormat.

For serial interface

Page 23: 8251 UART
Page 24: 8251 UART

Status register

flags for the receiver

Page 25: 8251 UART

Initialization of 8251A

Page 26: 8251 UART

assume

Answer = 5E

Page 27: 8251 UART
Page 28: 8251 UART

EXAMPLE 10.31

Page 29: 8251 UART
Page 30: 8251 UART
Page 31: 8251 UART

Reset