Search This Blog

Sunday, December 16, 2018

8251 USART

8251 is a Universal Synchronous/Asynchronous Receiver/Transmitter packaged in a 28-pin DIP made by Intel. It is typically used for serial communication and was rated for 19.2 kilobits per second signalling rate.

Major Functions
8251 universal synchronous asynchronous receiver transmitter (USART) acts as a mediator between microprocessor and peripheral to transmit serial data into parallel form and vice versa.
  1. It takes data serially from peripheral (outside devices) and converts into parallel data.
  2. After converting the data into parallel form, it transmits it to the CPU.
  3. Similarly, it receives parallel data from microprocessor and converts it into serial form.
  4. After converting data into serial form, it transmits it to outside device (peripheral).

ARCHITECTURE OF 8251



It contains the following blocks:
  1. Data bus buffer –
    This block helps in interfacing the internal data bus of 8251 to the system data bus. The data transmission is possible between 8251 and CPU by the data bus buffer block.
  2. Read/Write control logic –
    It is a control block for overall device. It controls the overall working by selecting the operation to be done. The operation selection depends upon input signal:
  3. .Modem control (modulator/demodulator) –A device converts analog signals to digital signals and vice-versa and helps the computers to communicate over telephone lines or cable wires. The following are active-low pins of Modem.........................................................*DSR Data Set Ready signal is an input signal.*DTR: Data terminal Ready is an output signal.*CTS: It is an input signal which controls the data transmit circuit.*RTS: It is an output signal which is used to set the status RTS.
  4. Transmit buffer –
    This block is used for parallel to serial converter that receives a parallel byte for conversion into serial signal and further transmission onto the common channel.
    • TXD: It is an output signal, if its value is one, means transmitter will transmit the data.
  5. Transmit control –
    This block is used to control the data transmission with the help of following pins:
    • TXRDY: It means transmitter is ready to transmit data character.
    • TXEMPTY: An output signal which indicates that TXEMPTY pin has transmitted all the data characters and transmitter is empty now.
    • TXC: An active-low input pin which controls the data transmission rate of transmitted data.
  6. Receive buffer –
    This block acts as a buffer for the received data.
    • RXD: An input signal which receives the data.
  7. Receive control –
    This block controls the receiving data.
    • RXRDY: An input signal indicates that it is ready to receive the data.
    • RXC: An active-low output signal which controls the data transmission rate of received data.
    • SYNDET/BD: An input or output terminal. External synchronous mode-input terminal and asynchronous mode-output terminal.

INTERFACING OF 8251 WITH 8086 


• The chip select for I/O mapped devices are generated by using a 3-to-8 decoder.
• The address lines A5, A6 and A7 are decoded to generate eight chip select signals 
(IOCS-0
to IOCS-7) and in this, the chip select signal IOCS-2 is used to select 825lA.
• The address line A0 and the control signal M/IO(low) are used as enable for 
decoder.
• The line A1 of 8086 is connected to C/D(low) of 8251A to provide the internal 
addresses.
• The lines D0 – D7 connected to D0 – D7 of the processor to achieve parallel data 
transfer.
• The RESET and clock signals are supplied by 8284 clock generator. Here the 
processor 
clock is directly connected to 8251A. This clock controls the parallel data transf
er
between the processor and 825lA.
• 8251A in I/O mapped in the system is shown in the figure.
The peripheral clock (PCLK) supplied by 8284, is divided by suitable clock dividers 
like programmable timer 8254 and then used as clock for serial transmission and 
reception.
• In 8251A the transmission and reception baud rates can be different or same.
• The TTL logic levels of the serial data lines and the control signals necessary for 
serial transmission and reception are converted to RS232 logic levels using MAX232 
and then
terminated on a standard 9-pin D-.type connector.
• The device, which requires serial communication with processor, can be 
connected to this
9-pin D-type connector using 9-core cable.


MODES OF OPERATION

Control Words

There are two types of control word.
1. Mode instruction (setting of function)
2. Command (setting of operation)

1) Mode Instruction

Mode instruction is used for setting the function of the 8251. 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 is shown in Figures 2 and 3. 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.


2) Command

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)


Status Word

It is possible to see the internal status of the 8251 by reading a status word. The bit configuration of status word is shown in Fig. 5.

Pin Description


D 0 to D 7 (l/O terminal)
This is bidirectional data bus which receive control words and transmits data from the CPU and sends status words and received data to CPU.
RESET (Input terminal)
A "High" on this input forces the 8251 into "reset status." The device waits for the writing of "mode instruction." The min. reset width is six clock inputs during the operating status of CLK.
CLK (Input terminal)
CLK signal is used to generate internal device timing. CLK signal is independent of RXC or TXC. However, the frequency of CLK must be greater than 30 times the RXC and TXC at Synchronous mode and Asynchronous "x1" mode, and must be greater than 5 times at Asynchronous "x16" and "x64" mode.
WR (Input terminal)
This is the "active low" input terminal which receives a signal for writing transmit data and control words from the CPU into the 8251.
RD (Input terminal)
This is the "active low" input terminal which receives a signal for reading receive data and status words from the 8251.
C/D (Input terminal)
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 CPU. If C/D = low, data will be accessed. If C/D = high, command word or status word will be accessed.
CS (Input terminal)
This is the "active low" input terminal which selects the 8251 at low level when the CPU accesses. Note: The device won’t be in "standby status"; only setting CS = High.
TXD (output terminal)
This is an output terminal for transmitting data from which serial-converted data is sent out. The device is in "mark status" (high level) after resetting or during a status when transmit is disabled. It is also possible to set the device in "break status" (low level) by a command.
TXRDY (output terminal)
This is an output terminal which indicates that the 8251is ready to accept a transmitted data character. But the terminal is always at low level if CTS = high or the device was set in "TX disable status" by a command. Note: TXRDY status word indicates that transmit data character is receivable, regardless of CTS or command. If the CPU writes a data character, TXRDY will be reset by the leading edge or WR signal.
TXEMPTY (Output terminal)
This is an output terminal which indicates that the 8251 has transmitted all the characters and had no data character. In "synchronous mode," the terminal is at high level, if transmit data characters are no longer remaining and sync characters are automatically transmitted. If the CPU writes a data character, TXEMPTY will be reset by the leading edge of WR signal. Note : As the transmitter is disabled by setting CTS "High" or command, data written before disable will be sent out. Then TXD and TXEMPTY will be "High". Even if a data is written after disable, that data is not sent out and TXE will be "High".After the transmitter is enabled, it sent out. (Refer to Timing Chart of Transmitter Control and Flag Timing)
TXC (Input terminal)
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. The falling edge of TXC sifts the serial data out of the 8251.
RXD (input terminal)
This is a terminal which receives serial data.
RXRDY (Output terminal)
This is a terminal which indicates that the 8251 contains a character that is ready to READ. If the CPU reads a data character, RXRDY will be reset by the leading edge of RD signal. Unless the CPU reads a data character before the next one is received completely, the preceding data will be lost. In such a case, an overrun error flag status word will be set.
RXC (Input terminal)
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.
SYNDET/BD (Input or output terminal)
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. The terminal will be reset, if RXD is at high level. After Reset is active, the terminal will be output at low level.
DSR (Input terminal)
This is an input port for MODEM interface. The input status of the terminal can be recognized by the CPU reading status words.
DTR (Output terminal)
This is an output port for MODEM interface. It is possible to set the status of DTR by a command.
CTS (Input terminal)
This is an input terminal for MODEM interface which is used for controlling a transmit circuit. The terminal controls data transmission if the device is set in "TX Enable" status by a command. Data is transmitable if the terminal is at low level.
RTS (Output terminal)
This is an output port for MODEM interface. It is possible to set the status RTS by a command.




No comments:

Post a Comment