a8251 Features General Description Programmable Communications Interface



Similar documents
Objectives. Basics of Serial Communication. Simplex vs Duplex. CMPE328 Microprocessors (Spring ) Serial Interfacing. By Dr.

UART IP Core Specification. Author: Jacob Gorban

Using Altera MAX Series as Microcontroller I/O Expanders

Manchester Encoder-Decoder for Xilinx CPLDs

Using Xbee in Serial Communication

8051 Serial Port. Crystal TXD. I/O Device RXD. Embedded Systems Peripherals

PART B QUESTIONS AND ANSWERS UNIT I

SC16C754B. 1. General description. 2. Features. 5 V, 3.3 V and 2.5 V quad UART, 5 Mbit/s (max.) with 64-byte FIFOs

Serial Communications

Application Note 83 Fundamentals of RS 232 Serial Communications

PCMCIA 1 Port RS EDITION OCTOBER 1999

8254 PROGRAMMABLE INTERVAL TIMER

Elettronica dei Sistemi Digitali Costantino Giaconia SERIAL I/O COMMON PROTOCOLS

DECT Module UM-9802 Datasheet

Microprocessor & Assembly Language

USART and Asynchronous Communication

RS-232 Communications Using BobCAD-CAM. RS-232 Introduction

UMBC. ISA is the oldest of all these and today s computers still have a ISA bus interface. in form of an ISA slot (connection) on the main board.

Manual Serial PCI Cards

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

USB TO SERIAL ADAPTER

WHQL Certification Approval...2 User Interface...3 SUNIX s COMLab..4

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

2.8.3 / (Z80 Serial I/O)

Measurement and Analysis Introduction of ISO7816 (Smart Card)

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

2-Port RS232/422/485 Combo Serial PCI Card

LS-101 LAN to Serial Device server. User s Manual

Memory Elements. Combinational logic cannot remember

RS-232 COMMUNICATIONS

SDLC Controller. Documentation. Design File Formats. Verification

ARM Thumb Microcontrollers. Application Note. Software ISO 7816 I/O Line Implementation. Features. Introduction

Computer Performance. Topic 3. Contents. Prerequisite knowledge Before studying this topic you should be able to:

Omron I/O Driver (Series 2) Programmable Serial Interface Card

AN_2901CE_001 JULY 2005

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

Enhancing High-Speed Telecommunications Networks with FEC

SC16C652B. 1. General description. 2. Features. 5 V, 3.3 V and 2.5 V dual UART, 5 Mbit/s (max.) with 32-byte FIFOs and infrared (IrDA) encoder/decoder

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

DS1621 Digital Thermometer and Thermostat

Data Cables. Schmitt TTL LABORATORY ELECTRONICS II

AVR151: Setup and Use of the SPI. Introduction. Features. Atmel AVR 8-bit Microcontroller APPLICATION NOTE

ULC Technology: High-performance gate array package using multiple metal layer CMOS technology featuring sub-micron channel lengths (0.

1-Port R422/485 Serial PCIe Card

PFB366 Profibus-DP Gateway User Manual

6-BIT UNIVERSAL UP/DOWN COUNTER

Introduction the Serial Communications Huang Sections 9.2, 10.2 SCI Block User Guide SPI Block User Guide

Industrial Multi-port Serial Cards

TASCAM SS-CDR200/SS-R200 CONTROL I/O Terminals RS-232C Protocol Specifications

RS-422/485 Multiport Serial PCI Card. RS-422/485 Multiport Serial PCI Card Installation Guide

Module 3: Floyd, Digital Fundamental

VMR6512 Hi-Fi Audio FM Transmitter Module

The I2C Bus. NXP Semiconductors: UM10204 I2C-bus specification and user manual HAW - Arduino 1

USB to serial chip CH340

AND8336. Design Examples of On Board Dual Supply Voltage Logic Translators. Prepared by: Jim Lepkowski ON Semiconductor.

Parallel IO. Serial IO. Parallel vs. Serial IO. simplex vs half-duplex vs full-duplex. Wires: Full Duplex. Wires: Simplex, Half-duplex.

Elo Interactive Digital Signage (IDS): Remote Management

isco Connecting Routers Back to Back Through the AUX P

RJ45 Shielded (standard) port pinout. CS9000, Jetstream , Lanstream 2000, RTA8/RJX, RRC16, MTA8/RJX & SXDC8/RJX

Serial Communications / Protocol in AirTest Products

Below is a diagram explaining the data packet and the timing related to the mouse clock while receiving a byte from the PS-2 mouse:

KSH-3000-MI. Swipe Card Reader. ( Magnetic / IC Card two in One Reader ) Revision Reason Date V

INFORMATICA INDUSTRIALE

TERMINAL Debug Console Instrument

Application Note AN_241. FTDI_AOA_HyperTerm_User_Manual

Technical Note. Micron NAND Flash Controller via Xilinx Spartan -3 FPGA. Overview. TN-29-06: NAND Flash Controller on Spartan-3 Overview

Decimal Number (base 10) Binary Number (base 2)

LINDY ELECTRONICS LIMITED & LINDY-ELEKTRONIK GMBH - SECOND EDITION

RS232C < - > RS485 CONVERTER S MANUAL. Model: LD15U. Phone: / 97 / 98 (M)

Modbus Communications for PanelView Terminals

MICROPROCESSOR AND MICROCOMPUTER BASICS

USER GUIDE EDBG. Description

RS-485 Protocol Manual

Communication Unit 560CMU05 Data sheet

How to setup a serial Bluetooth adapter Master Guide

CHAPTER 11: Flip Flops

INFORMATICA INDUSTRIALE

FT232BM /FT245BM BIT BANG MODE

2-Port RS232/422/485 Combo Serial to USB2.0 Adapter (w/ Metal Case and Screw Lock Mechanism) Installation Guide

AVR305: Half Duplex Compact Software UART. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

BLUETOOTH SERIAL PORT PROFILE. iwrap APPLICATION NOTE

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester

USB2.0 <=> I2C V4.4. Konverter Kabel und Box mit Galvanischetrennung

Chapter 4 T1 Interface Card

MAX II ISP Update with I/O Control & Register Data Retention

Serial Communications

SyncLink GT2/GT4 Serial Adapter

LTM-1338B. Plus Communications Manual

16-Port RS232 to USB2.0 High Speed Multi Serial Adapter (w/ Metal Case) Installation Guide

PHY Interface For the PCI Express, SATA, and USB 3.0 Architectures Version 4.0

SC16IS740/750/760. Single UART with I 2 C-bus/SPI interface, 64 bytes of transmit and receive FIFOs, IrDA SIR built-in support

AVR1309: Using the XMEGA SPI. 8-bit Microcontrollers. Application Note. Features. 1 Introduction SCK MOSI MISO SS

WHQL Certification Approval...2 User Interface K software FIFO 4 Universal PCI Interface...5 Ready for 64-bit System...5

AVR317: Using the Master SPI Mode of the USART module. 8-bit Microcontrollers. Application Note. Features. Introduction

Chapter 5 :: Memory and Logic Arrays

AVR32100: Using the AVR32 USART. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

CENTRONICS interface and Parallel Printer Port LPT

Appendix A. This Appendix includes the following supplemental material:

COMPUTER HARDWARE. Input- Output and Communication Memory Systems

Transcription:

a8251 Programmable Communications Interface June 1997, ver. 2 Data Sheet Features a8251 MegaCore function that provides an interface between a microprocessor and a serial communication channel Optimized for FLE architecture Programmable word length, stop bits, and parity Offers divide-by-1, -16, or -64 mode Supports synchronous and asynchronous operation Uses approximately 528 FLE logic elements (LEs) Includes: Error detection False start bit detection Automatic break detection Internal and external sync character detection Functionally based on the Intel M8251A device, except as noted in the Variations & Clarifications on page 44 General Description The a8251 MegaCore function provides an interface between a microprocessor and a serial communications channel. The a8251 receives and transmits data in a variety of configurations including 7- or 8-bit data words, with odd, even, or no parity, and 1 or 2 stop bits. The transmitter and receiver can be designed for synchronous or asynchronous operation. See Figure 1. Figure 1. a8251 Symbol CLK CnD DIN[7..0] ETSYNCD ncs ncts ndsr nrd nrc ntc nwr RESET RD A8251 DOUT[7..0] ndtr nen nrts RRDY SYN_BRK TD TEMPTY TRDY Altera Corporation 25 A-DS-A8251-2

Table 1 describes input and output ports of the a8251. Table 1. a8251 Ports (Part 1 of 2) Name Type Polarity Description clk Input Master clock input. cnd Input Control/data select. When the cnd signal goes high, the microprocessor selects status/control data to read/write; otherwise, the microprocessor selects receiver/transmitter data to read/write. din[7..0] Input Parallel data input from the microprocessor or other controlling device. extsyncd Input High External sync detect. In synchronous designs, when the extsyncd signal is asserted, the a8251 begins receiving data on the next rising edge of the nrxc signal. ncs Input Low Chip select from the microprocessor. When the ncs signal is asserted, all read or write operations are enabled. ncts Input Low Clear to send, typically a modem signal name. When the ncts signal is asserted, and if the txen bit of the command instruction register is set, data transmission is enabled. ndsr Input Low Data set ready, typically a modem signal name. The state of this input may be tested by reading status register bit 7 (dsr). nrd Input Low Read control for the registers. When the nrd and the ncs signals are both low, the microprocessor reads from the registers. nrxc Input Low Receive clock. The receiver control logic samples the nrxd based on the state of the nrxc signal and the baud rate factor bits in the mode instuction register. ntxc Input Low Transmit clock. Data is asserted to the txd on the falling edge of ntxc. nwr Input Low Write control for the registers. When the nwr and the ncs signals are both low, the microprocessor writes to the registers. nreset Input Low Asynchronous reset for the registers and control logic. rxd Input Receive data. Serial input from the modem or peripheral. dout[7..0] Output Low Parallel data output to the microprocessor or other controlling device. ndtr Output Low Data terminal ready, typically a modem signal name. Bit 1 of the command instruction register sets the ndtr signal. nen Output Low Output enable for the output data bus. When the nen signal is asserted, the output data is enabled on the dout[7..0] bus line. nrts Output Low Request to send, typically a modem signal name. Bit 5 of the command instruction register sets the nrts signal. rxrdy Output High Receiver ready. A high rxrdy signal indicates that the a8251 has received a character to be read by the microprocessor. syn_brk Output High Sync/break detect. In synchronous operation, when the extsyncd signal is asserted, the a8251 begins receiving data on the next rising edge of the nrxc signal. In asynchronous operation, syn_brk indicates a break condition on rxd. 26 Altera Corporation

Table 1. a8251 Ports (Part 2 of 2) Name Type Polarity Description txd Output Transmit data. Serial output to modem or peripheral. txempty Output High Transmitter empty. Indicates that the transmitter logic has no more data to send. txrdy Output High Transmitter ready. When the txrdy signal is asserted, the transmitter logic is ready to receive another data byte. This output is conditional upon the state of the cts input and the txen command bit. Functional Description Figure 2 shows the a8251 block diagram. Figure 2. a8251 Block Diagram ncs nrd txd nwr cnd Read/Write Control Logic & Registers Transmitter Logic txrdy txempty ntxc din[7..0] dout[7..0] rxd Receiver Logic rxrdy nrxc syn_brk extsyncd reset clk ndsr Modem Control ndtr ncts nrts Altera Corporation 27

The a8251 contains the following registers: Mode instruction Command instruction Status Sync character one Sync character two Transmitter buffer Receiver buffer Mode Instruction Register The mode instruction register (MIR) supports both synchronous and asynchronous operation. Bits 0 and 1 of the MIR are the baud rate factor bits and determine the ratio between the data rate and the clocks. If bits 0 and 1 are set to a logic low, then the a8251 is programmed for synchronous operation; otherwise, the a8251 operates asynchronously. Asynchronous Operation When the a8251 is programmed for asynchronous operation, the MIR contains the bits shown in Table 2. Table 2. Mode Instruction Register Bits (Asynchronous Operation) Data Bit Signal Name 0 Baud rate factor (b1) 1 Baud rate factor (b2) 2 Word length select (l1) 3 Word length select (l2) 4 Parity select (pen) 5 Parity select (ep) 6 Stop bit select (s1) 7 Stop bit select (s2) 28 Altera Corporation

Baud Rate Factor Bits 0 and 1 (b1, b2) of the MIR are the baud rate factor bits, which determine the ratio between the data rate and the clocks. The ratios are identical when transmitting and receiving. The baud rate factor bits also provide a means of programming the a8251 for synchronous operation. Table 3 shows the logic level of the baud rate factor bits and the corresponding programmed function. Table 3. Baud Rate Factor Bits b2 b1 Programmed Function 0 0 Synchronous operation. 0 1 Divide-by-1 mode. Clock and data rates are identical. External logic is responsible for synchronizing the rxd signal to the nrxc signal. The rxd signal is sampled on the rising edge of the nrxc signal, and the txd signal is asserted on the falling edge of the ntxc signal. 1 0 Divide-by-16 mode. The clock rate is 16 times the data rate. After start bit detection (rxd low), the rxd signal is sampled on the ninth rising edge of nrxc. After writing to the transmitter register, the txd signal is asserted on the first falling edge of the ntxc signal and every 16 clocks thereafter. 1 1 Divide-by-64 mode. The clock rate is 64 times the data rate. After start bit detection (rxd low), the rxd signal is sampled on the 33rd rising edge of the nrxc. After writing to the transmitter register (assuming the transmission is enabled), txd is asserted on the first falling edge of the ntxc signal and every 64 clocks thereafter. Word Length Select Bits 2 and 3 (l1, l2) of the MIR are the word length select bits, which are used to select the character length of the data byte. Table 4 shows the logic level of the word length select bits and the corresponding word length. Altera Corporation 29

Table 4. Word Length Select Bits l2 l1 Word Length 0 0 5 0 1 6 1 0 7 1 1 8 Parity Select Bits 4 and 5 (pen, ep) of the MIR are the parity select bits, which are used to select the parity options. Table 5 shows the logic level of the parity select bits and the corresponding parity. Table 5. Parity Select Bits ep pen Parity 0 0 None 0 1 Odd 1 0 None 1 1 Even Stop Bit Select Bits 6 and 7 (s1, s2) of the MIR are the stop bit select bits, which are used to determine the number of stop bits. Table 6 shows the logic level of the stop bit select bits and the corresponding number of stop bits. Table 6. Stop Bit Select BIts s2 s1 Number of Stop Bits 0 0 Invalid 0 1 1 1 0 1.5 1 1 2 Synchronous Operation When the a8251 is programmed for synchronous operation, the MIR contains the bits shown in Table 7. 30 Altera Corporation

Table 7. Mode Instruction Register Bits (Synchronous Operation) Data Bit Bit Name 0 Baud rate factor (b1) 1 Baud rate factor (b2) 2 Word length select (l1) 3 Word length select (l2) 4 Parity select (pen) 5 Parity select (ep) 6 External sync detect (esd) 7 Single character sync (scs) Baud Rate Factor When programmed for synchronous operation, the MIR s baud rate factor bits (bit 0 and bit 1) are always a logic low. Word Length Select Bits 2 and 3 (l1, l2) of the MIR are the word length select bits, which are used to select the word length of the data byte. These bits function identically when programmed for asynchronous or synchronous operation. Parity Select Bits 4 and 5 (pen, ep) of the MIR are the parity select bits, which are used to select the parity options. These bits function identically when programmed for asynchronous or synchronous operation. External Sync Detect When bit 6 (esd) of the MIR is high, external sync detection is used by the a8251 receiver. Otherwise the receiver is responsible for sync detection. Single Character Sync When bit 7 (scs) of the MIR is high, the receiver looks for a single sync character before beginning the synchronization process. Otherwise the receiver looks for two sync characters. Altera Corporation 31

Command Instruction Register The command instruction register controls transmitter/receiver operations. Table 8 shows the format, signal name, and function of the command instruction register data bits. Table 8. Command Instruction Register Format Data Bit Signal Name Function 0 Transmitter enable (txen) A logic high enables the transmitter. 1 Data terminal ready (dtr) A logic high forces the ndtr signal to go low. 2 Receiver enable (rxe) A logic high enables the receiver. 3 Send break character (sbrk) A logic high forces the txd signal to go low. 4 Error reset (er) A logic high resets all error signals (pe, oe, fe). 5 Request to send (rts) A logic high forces the nrts signal to go low. 6 Internal reset (ir) A logic high forces an internal state reset operation. 7 Enter hunt (eh) A logic high causes the receiver to hunt for sync characters. The eh command is ignored during asynchronous operation. Status Register The status register allows the microprocessor, or other controlling device, to examine the condition of the a8251. Table 9 shows the format, signal name, and function of the status register data bits. 32 Altera Corporation

Table 9. Status Register Format Data Bit Signal Name 0 Transmitter ready (txrdy) Function Indicates that the transmitter is ready to receive another data byte. Unlike the corresponding output, this bit is not conditional upon the cts input and the txen command bit. 1 Receiver ready (rxrdy) Bit 1 reflects the state of the rxrdy signal. 2 Transmitter empty Bit 2 reflects the state of the txempty signal. (txempty) 3 Parity error (pe) Note (1) 4 Overrun error (oe) Note (1) 5 Framing error (fe) Note (1) When high, bit 3 indicates that the parity bit received over the rxd input does not match the parity calculated by the receiver. If no parity has been selected, this error will not occur. Bit 4 indicates that data was ready to write into the RBR before the previous contents of the register were read by the microprocessor. Bit 5 is set when a received character does not end with the expected number of stop bits, which is usually caused by a transmission error. 6 Sync or break detect Bit 6 reflects the state of the syn_brk output. (syn_brk) 7 Data set ready (dsr) Bit 7 reflects the logical inverse of the state of the ndsr input. Note: (1) A pe, oe, or fe error signal can be cleared by a total state reset (see Reset Operation section on page 42), by an internal state reset, or by writing a logic high to bit 4 (er) of the command instruction register. Sync Character One Register The sync character one register holds the first sync character. The information is used by the receiver for sync comparison and by the transmitter for sync character transmission. Altera Corporation 33

Sync Character Two Register The sync character two register holds the value of the second sync character. The information is used by the receiver for sync comparison and by the transmitter for sync character transmission. Transmitter Buffer Register The transmitter buffer register (TBR) holds the transmitter data, which the a8251 formats, serializes, and transmits on the txd output. Once the existing data bits in the shift register are completely transmitted, the TBR transfers new data into the shift register. Receiver Buffer Register The receiver buffer register (RBR) holds the data received from the shift register. After the shift register receives a new data word, it is ready to transfer the new data word to the RBR. If the existing data in the RBR has already been read by the microprocessor, then the transfer takes place. If the existing RBR data has not been read, the overrun error (oe) bit is set. Operation This section describes the following: Programming operation Receiver operations: asynchronous and synchronous Transmitter operations: asynchronous and synchronous Reset operation Programming Operation The a8251 must be programmed in a specific order and immediately following a total state reset or an internal state reset. First, the microprocessor writes to the MIR. When synchronous operation is selected in the MIR, the microprocessor writes to the first sync character. If two sync characters are selected in the MIR, the second character is written immediately after the first; if only one sync character is selected, the second character is skipped. However, when asynchronous operation is selected, both sync characters are skipped. Once the microprocessor writes to the MIR and sync characters (if appropriate), the command instruction, status, TBR and RBR can be randomly accessed. Table 10 outlines the a8251 programming sequence including the logic level of control signals. 34 Altera Corporation

Table 10. a8251 Programming Sequence cnd nrd nwr ncs Operation Comment 1 1 0 0 Microprocessor writes to the MIR. Must occur immediately following a total state reset or internal state reset. 1 1 0 0 Microprocessor writes the first sync character. Skipped in asynchronous operation. 1 1 0 0 Microprocessor writes the second sync character. 1 1 0 0 Microprocessor writes to the Random access. command instruction register. 0 1 0 0 Microprocessor writes to the TBR. Random access. 1 0 1 0 Microprocessor reads the status Random access. register. 0 0 1 0 Microprocessor reads the RBR. Random access. Skipped in asynchronous operation or if bit 7 of the MIR (synchronous operation) is set to a logic high. Receiver Operation (Asynchronous) When the a8251 is programmed for asynchronous operation, the receiver includes the following functions: Start bit detection Data bit sampling Parity/stop bit detection Error detection Receiver buffer register transfer Break detection Start Bit Detection The a8251 begins receiving data when a start bit is detected. A start bit is a logic low on the rxd input, which is sampled on each rising clock edge of the nrxc signal. Once the a8251 detects a logic low, it begins counting the number of logic low samples according to the specified divide-by mode. Altera Corporation 35

For example, after detecting a logic low in divide-by-1 mode, the a8251 assumes data is available on the next rising edge. However, after detecting a logic low in divide-by-16 mode, the a8251 counts 8 nrxc edges and samples again. The data must still be a logic low. At this point, the a8251 assumes the data and clock are synchronized, and samples data every 16 clock edges thereafter. Divide-by-64 mode is similar to divide-by-16, with the start bit sampled at the first rising edge and the 32nd rising edge of nrxc. Data is then sampled every 64 rising edges. Data Bit Sampling After detecting a start bit, the a8251 samples and shifts the data into the shift register. Data bit sampling occurs on every rising edge in divide-by- 1 mode, every 16 rising edges in divide-by-16 mode, and every 64 rising edges in divide-by-64 mode. Each time a bit is sampled, parity is calculated for future error detection. See Figure 3. Figure 3. Receiver Clock Signals nrxc (Divide-by-1) nrxc (Divide-by-16) Sampling Pulse (Divide-by-16) Parity/Stop Bit Detection The a8251 counts the number of data bits as it shifts. When the number of data bits received matches the number specified in the control register, the a8251 expects either a parity bit or a stop bit. If parity is enabled, the a8251 samples for the parity bit, which is processed for parity but is not shifted into the shift register. After the parity bit, or after the last data bit if parity is not enabled, the a8251 expects a stop bit (i.e., logic high). If a logic low is sampled, the fe bit is set in the status register. The a8251 receives data with one or two stop bits. If one stop bit is specified in the control register, the a8251 will expect one stop bit before starting the synchronization process. Similarly, if two stop bits are specified, the synchronization process begins after detecting two logic highs. 36 Altera Corporation

Error Detection Three errors can occur when the a8251 is receiving: framing, overrun, and parity. Refer to Table 9 on page 33 of this data sheet for error definitions. Receiver Buffer Register Transfer Once the last stop bit is received, or a framing error is detected, the data in the shift register is transferred to the RBR. At this point, all status bits associated with this data word are set, including the rxrdy bit. The receiver process concludes when the microprocessor reads data from the RBR. Break Detection In asynchronous operation, the syn_brk signal indicates that the receiver has detected a break condition. A break condition is defined as the condition when the rxd signal is continuously low, i.e., for an entire character sequence including start, stop, and parity bits. The syn_brk bit can be reset by a total state reset operation or by the rxd signal returning to a logic high. See Figure 4. Figure 4. Receiver Control & Error Signals (Asynchronous) The indicates don t care. syn_brk fe oe Second Data Bit Lost rxrdy cnd nwr nrd rxd First Data Bit Second Data Bit Third Data Bit Altera Corporation 37

Transmitter Operation (Asynchronous) When the a8251 is programmed for asynchronous operation, the transmitter includes the following functions: Transmitter data register write/transfer Transmitter start bit Transmitter data Transmitter parity bit Transmitter stop bit Transmitter Data Register Write/Transfer After a total state reset operation and when bit 1 (txen) of the command instruction register is high, a transmit operation begins when the ncts signal is asserted. At this point, a data byte can be written to the TBR. However, if no data is written, the txd signal is held in a logic high state. In the initial write operation, if the shift register is empty, the data is immediately transferred and the shift operation begins. If a shift operation is underway, the microprocessor can write to the TBR; however, the data is not transferred to the shift register until the active shift operation is finished. When the TBR contains data that has not been transferred to the shift register, the txrdy signal and corresponding status bit go low. Once the data is transferred to the shift register and the TBR is empty, the txrdy signal and corresponding status bit will again be asserted. If both the shift register and TBR become empty, the txempty signal and corresponding status bit will be asserted. See Figure 5. 38 Altera Corporation

Figure 5. Transmitter Control & Error Signals (Asynchronous) The indicates don t care. ncts txempty txrdy (Status Bit) txrdy (Pin) cnd nwr txd First Data Bit Second Data Bit Third Data Bit Transmitter Start Bit When data is transferred to the shift register, a start bit (i.e., logic low) is placed on the txd signal on the falling edge of the ntxc signal. The start bit value remains active for the number of clock cycles specified by the divide-by mode (i.e., 1, 16, or 64). See Figure 6. Figure 6. Transmitter Data & Clock Signals ntxc (Divide-by-1) ntxc (Divide-by-16) txd Start Bit Data Bit Transmitter Data After the start bit is transmitted, the data bits shift out of the TBR one at a time, from the least significant to the most significant. The cycle time for each bit starts at the beginning of the clock cycle, which depends on the specified divide-by mode. The number of bits shifted out corresponds to the number of bits specified in the MIR. Altera Corporation 39

Transmitter Parity Bit If parity is enabled, the bit following the last data bit is the parity bit. The parity bit has a value that forces the entire data byte to have the correct parity. For example, if parity is set to odd in the MIR, then the parity bit guarantees there are an odd number of 1s (i.e., data plus the parity bit). If parity is set to even, then the parity bit guarantees there are an even number of 1s. Transmitter Stop Bit After the parity bit is transmitted, or the last data bit if parity is not enabled, one or two stop bits are transmitted on the txd output. The output then stays high until the beginning of the next data word transmission. Receiver Operation (Synchronous) When the a8251 is programmed for synchronous operation, start or stop bits are not added to the data word. Instead the rxd signal is synchronous to the receive clock (nrxc signal), and the data stream is synchronized to the receiving a8251 by the recognition of a sync character or characters. See Figure 7. Figure 7. Receiver Control & Error Signals (Synchronous) The indicates don t care. extsyncd syn_brk (Status Bit) oe (Status Bit) rxrdy (Pin) cnd Data Character Two Lost nwr nrd Sync Characters One Two Data Characters One Two Three Sync Characters One Two nrxd Parity Bit Parity Bit Parity Bit Parity Bit 40 Altera Corporation

Synchronization may occur either externally or internally. When external sync detect is selected, the synchronization process is as follows: 1. The microprocessor issues an enter hunt (eh) command to the command instruction register. 2. The external sync detect circuitry forces the extsyncd signal high for at least one nrxc cycle. The extsyncd is sampled on the falling edge of nrxc, which forces the a8251 to stop looking for sync characters. At this point, the a8251 begins sampling rxd on the next rising edge of nrxc. The syn_brk signal and corresponding status bit are asserted and automatically cleared when the microprocessor reads the status data. When internal sync detect is selected, the receiver is responsible for detecting sync characters on the rxd signal. The sequence is as follows: 1. The microprocessor issues an enter hunt (eh) command to the command instruction register. 2. The receiver section begins sampling for rxd on the rising edge of nrxc. The rxd input data is compared to the sync character(s). 3. Upon detecting the sync character(s), the a8251 begins sampling for the rxd signal on the next rising edge of nrxc. The syn_brk output and the corresponding status bit are asserted and automatically cleared when the microprocessor reads the status data. Parity and overrun errors are detected as in asynchronous operation. Synchronous operation continues until the microprocessor issues another enter hunt (eh) command. Transmitter Operation (Synchronous) A transmitter operation starts when the microprocessor writes the first character (usually a sync character) to the TBR. Once the ncts signal is asserted, the a8251 begins shifting the data byte out on the falling edge of the ntxc signal. Data transmission is synchronous to the ntxc clock. As in asynchronous operation, a parity bit is added to each data byte to determine the parity. See Figure 8. Altera Corporation 41

Figure 8. Transmitter Control Signals (Synchronous) The indicates don t care. ncts txempty txrdy (Status Bit) txrdy (Pin) cnd nwr txd Sync Characters One Two Data Characters One Two Sync Characters One Two Parity Bit Parity Bit Parity Bit The txrdy and txempty signals function identically when programmed for asynchronous or synchronous operation. However, when the transmitter becomes empty, the a8251 automatically inserts sync characters into the data stream. If the scs signal is high, a single sync character is inserted. Otherwise, two sync characters are inserted. Reset Operation The a8251 is reset in one of two ways: Total state reset Internal state reset Total state reset is an asynchronous operation achieved by asserting the reset input. All internal registers and control logic are asynchronously reset to their initial state. Internal state reset is achieved by writing a logic high into bit 6 (ir) of the command instruction register, which resets all internal registers and control logic to their initial state. Internal state reset occurs synchronously to the rising edge of the clk signal. The master clock signal (clk) must be running to achieve an internal state reset. 42 Altera Corporation

Timing Waveforms Figure 9 shows the read and write control cycles for the a8251. Figure 9. Read & Write Control Cycles The indicates don t care. Read Control ndsr, ncts ncs cnd nrd dout Valid Data Write Control ndtr, nrts ncs cnd nwr din Valid Data Altera Corporation 43

Figure 10 shows the read and write data cycles for the a8251. Figure 10. Read & Write Data Cycles The indicates don t care. Read Data rxrdy nrd din Valid Data cnd ncs Write Data txrdy nwr din Valid Data cnd ncs Variations & Clarifications The following characteristics distinguish the Altera a8251 from the Intel 8251A device: The a8251 has separate input and output data buses, while the Intel 8251A device has a bidirectional data bus. The a8251 has separate extsyncd and syn_brk signals, while the Intel 8251A device has a bidirectional SYNDET/BRKDET signal. In a write cycle to the a8251, the din[7..0] inputs must be held for one ntxc clock cycle after the rising edge of the nwr signal. The a8251 has an active low reset input. The Intel 8251A has an active-high reset input. 44 Altera Corporation

Copyright 1995, 1996, 1997, 1998 Altera Corporation, 101 Innovation Drive, San Jose, CA 95134, USA, all rights reserved. By accessing this information, you agree to be bound by the terms of Altera s Legal Notice.