D16550 Configurable UART with FIFO ver 2.03 OVERVIEW The D16550 is a soft Core of a Universal Asynchronous Receiver/Transmitter (UART) functionally identical to the TL16C550A. The D16550 allows serial transmission in two modes: UART mode and FIFO mode. In FIFO mode internal FIFOs are activated allowing 16 bytes (plus 3 bits of error data per byte in the RCVR FIFO) to be stored in both receive and transmit directions. D16550 performs serial-toparallel conversion on data characters received from a peripheral device or a MODEM, and parallel-to-serial conversion on data characters received from the CPU. The CPU can read the complete status of the UART at any time during the functional operation. Status information reported includes the type and condition of the transfer operations being performed by the UART, as well as any error conditions (parity, overrun, framing, or break interrupt). D16550 includes a programmable baud rate generator that is capable of dividing the timing reference clock input by divisors of 1 to (216-1), and producing a 16 x clock for driving the internal transmitter logic. Provisions are also included to use this 16 x clock to drive the receiver logic. The D16550 has complete MODEM control capability, and a processor-interrupt system. Interrupts can be programmed to the user's requirements, minimizing the computing required to handle the communications link. The separate BAUD CLK line allows to set an exact transmission speed, while the UART All trademarks mentioned in this document are trademarks of their respective owners. internal logic is clocked with the CPU frequency. The configuration capability allows user to enable or disable during Synthesis process the Modem Control Logic and FIFO's Control Logic, change the FIFO size. So in applications with area limitation and where the UART works only in 16450 mode, disabling Modem Control and FIFO's allow to save about 50% of logic resources. The D16550 has universal microcontroller interface, allows correct communication with D16550 no matter how D16550 clock is related to microcontroller clock. The core is perfect for applications, where the UART Core and microcontroller are clocked by the same clock signal and are implemented inside the same ASIC or FPGA chip, as well as for standalone implementation, where several UARTs are required to be implemented inside a single chip, and driven by some off-chip devices. Thanks to universal interface D16550 core implementation and verification are very simply, by eliminating a number of clock trees in complete system. KEY FEATURES Software compatible with 16450 and 16550 UARTs Configuration capability Separate configurable BAUD clock line Two modes of operation: UART mode and FIFO mode http://www.DigitalCoreDesign.com http://www.dcd.pl Copyright 1999-2003 DCD - Digital Core Design. All Rights Reserved. Majority Voting Logic In the FIFO mode transmitter and receiver are each buffered with 16 byte FIFO to reduce the number of interrupts presented to the CPU Adds or deletes standard asynchronous communication bits (start, stop, and parity) to or from the serial data In UART mode receiver and transmitter are double buffered to eliminate a need for precise synchronization between the CPU and serial data Independently controlled transmit, receive, line status, and data set interrupts False start bit detection 16 bit programmable baud generator MODEM control functions (CTS, RTS, DSR, DTR, RI, and DCD) Fully programmable characteristics: Even, odd, or no-parity bit generation and detection 1-, 11/2-, or 2-stop bit generation Baud generation Complete status reporting capabilities Line break generation and detection. Internal diagnostic capabilities: Loop-back controls for communications link fault isolation Break, parity, overrun, framing error simulation As an option the UART Core can be equipped with the asynchronous input buffer allows correct communication with D16550 no matter how D16550 clock is related to microcontroller clock. independent Delivery the IP Core updates, minor and major versions changes Delivery the documentation updates Phone & email support LICENSING 5-, 6-, 7-, or 8-bit characters Source code: VHDL Source Code or/and VERILOG Source Code or/and Encrypted, or plain text EDIF netlist VHDL & VERILOG test bench environment Active-HDL automatic simulation macros ModelSim automatic simulation macros Tests with reference responses Technical documentation Installation notes HDL core specification Datasheet Synthesis scripts Example application Technical support IP Core implementation support 3 months maintenance serial-interface DELIVERABLES Technology Code HDL Full prioritized interrupt system controls Fully synthesizable static design with no internal tri-state buffers Comprehensible and clearly defined licensing methods without royalty fees make using of IP Core easy and simply. Single Design license allows use IP Core in single FPGA bitstream and ASIC implementation. Unlimited Designs, One Year licenses allow use IP Core in unlimited number of FPGA bitstreams and ASIC implementations. In all cases number of IP Core instantiations within a design, and number of manufactured chips are unlimited. There is no time restriction except One Year license where time of use is limited to 12 months. Source Single Design license for VHDL, Verilog source code called HDL Source Encrypted, or plain text EDIF called Netlist APPLICATIONS Serial Data communications applications Modem interface One Year license for Unlimited Designs license for HDL Source Netlist Upgrade from All trademarks mentioned in this document are trademarks of their respective owners. Encrypted Netlist only HDL Source to Netlist http://www.DigitalCoreDesign.com http://www.dcd.pl Copyright 1999-2003 DCD - Digital Core Design. All Rights Reserved. Single Design to Unlimited Designs SYMBOL CONFIGURATION rst clk rclk baudclk The following parameters of the D16550 core can be easy adjusted to requirements of dedicated application and technology. Configuration of the core can be prepared by effortless changing appropriate constants in package file. There is no need to change any parts of the code. * Baud generator - enable disable * External RCLK source - enable disable * External BAUDCLK source - enable disable * Modem Control logic - enable disable * SCR Register - enable disable * FIFO Control logic - enable disable baudout intr datai(7:0) address(2:0) wr rd cs datao(7:0) si ddis txrdy rxrdy so cts dsr dcd ri rts dtr out1 out2 D16550 baudclken rclken PINS DESCRIPTION PIN TYPE DESCRIPTION rst input Global reset clk input Global clock DESIGN FEATURES datai[7:0] input Parallel data input The functionality of the D16550 core was based on the Texas Instruments TL16C550A. The following characteristics differentiate the D16550 from Texas Instruments devices: The bi-directional data bus has been split into two separate buses: datai(7:0), datao(7:0) addr[2:0] input Address bus cs input Chip select input wr input Write input rd input Read input rclk input Receiver clock baudclk input Baud generator clock si input Serial data input Signals rd2 and wr2, xin, and xout have been removed from interface cts input Clear to send input dsr input Data set ready input Signal ADS and address latch have been removed dcd input Data carrier detect input ri input Ring indicator input The DLL, DLM and THR registers are reset to all zeros baudclken input Baud generator clock enable rclken input Receiver clock enable baudout output Baud generator output TEMT and THRE bits of Line Status Register, are reset during the second clock rising edge following a THR write datao[7:0] output Parallel data output so output Serial data output ddis output Driver disable output RCLK clock is replaced by global clock CLK, internally divided by BAUD factor. txrdy output Transmitter ready output rxrdy output Receiver ready output Asynchronous microcontroller interface is replaced by equivalent Universal interface rts output Request to send output dtr output Data terminal ready output All latches implemented in original 16550 devices are replaced by equivalent flip-flop registers, with the same functionality out1 output Output 1 out2 output Output 2 intr output Interrupt request output All trademarks mentioned in this document are trademarks of their respective owners. Note: When enabled RCLK and BAUDCLK pins frequency should be at least two times lower than CLK, 2*fRCLK< fCLK http://www.DigitalCoreDesign.com http://www.dcd.pl Copyright 1999-2003 DCD - Digital Core Design. All Rights Reserved. Interrupt Controller - D16550 consists fully prioritized interrupt system controller. It controls interrupt requests to the CPU and interrupt priority. Interrupt controller contains Interrupt Enable (IER) and Interrupt Identification (IIR) registers. APPLICATION addr CPU ale addr latch datao(7:0) datai(7:0) we rd cs int ready addr(2:0) clk rst D16550 baudclk rclk datai(7:0) so datao(7:0) si wr rts rd dtr cs dsr intr dcd ready cts rxrdy ri txrdy out1 baudclken out2 rclken EIA Drivers Typical D16550 and processor connection is shown in figure above. BLOCK DIAGRAM Data Bus Buffer - The data Bus Buffer accepts inputs from the system bus and generates control signals for the other D16550 functional blocks. Address bus ADDR(2:0) selects one of the register to be read from/written into. Both RD and WE signals are active low, and are qualified by CS; RD and WE are ignored unless the D16550 has been selected by holding CS low. Baud Generator - The D16550 contains a programmable 16 bit baud generator that divides clock input by a divisor in the range between 1 and (216-1). The output frequency of the baud generator is 16x the baud rate. The formula for the divisor is: divisor = frequency baudrate *16 Two 8-bit registers, called divisor latches DLL and DLM, store the divisor in a 16-bit binary format. These divisor latches must be loaded during initialization of the D16550 in order to ensure desired operation of the baud generator. When either of the divisor latches is loaded, a 16-bit baud counter is also loaded on the CLK rising edge following the write to DLL or DLM to prevent long counts on initial load. addr(2:0) datai(7:0) datao(7:0) rd wr cs Data Bus Buffer ddis txrdy rxrdy Receiver Control & Shift Register RCV R Buffer & RCV R FIFO rts cts dtr dsr dcd ri out1 out2 baudclk baudclken baudout Modem control logic Trans mitter Control & Shift Register so RCV R Buffer & RCV R FIFO Baud Generator clk rst Interrupt Controller intr Receiver Control - Receiving starts when the falling edge on Serial Input (SI) during IDLE State is detected. After starting the SI input is sampled every 16 internal baud cycles as it is shown in figure below. When the logic 1 state is detected during START bit it means that the False Start bit was detected and receiver back to the IDLE state. Receiver FIFO - The Rx FIFO is 16 levels deep, it receives data until the number of bytes in the FIFO equals the selected interrupt trigger level. At that time if Rx interrupts are enabled, the UART will issue an interrupt to the CPU. The Rx FIFO will continue to store bytes until it holds 16 of them. It will not accept any more data when it is full. Any more data entering the Rx shift register will set the Overrun Error flag. Modem Control Logic controls the interface with the MODEM or data set (or a peripheral device emulating a MODEM). All trademarks mentioned in this document are trademarks of their respective owners. rclk rclken si http://www.DigitalCoreDesign.com http://www.dcd.pl Copyright 1999-2003 DCD - Digital Core Design. All Rights Reserved. Transmitter Control module controls transmission of written to THR (Transmitter Holding register) character via serial output SO. The new transmission starts on the next overflow signal of internal baud generator, after writing to THR register or Transmitter FIFO. Transmission control contains THR register and transmitter shift register. PERFORMANCE The following table gives a survey about the Core area and performance in the ALTERA(R) devices after Place & Route: Speed grade -6 -5 -5 -7 -7 -1 -1 -1 -1 Device CYCLONE STRATIX MERCURY APEX II APEX20KC APEX20KE APEX20K ACEX1K FLEX10KE Transmitter FIFO - the Tx portion of the UART transmits data through SO as soon as the CPU loads a byte into the Tx FIFO. The UART will prevent loads to the Tx FIFO if it currently holds 16 characters. Loading to the Tx FIFO will again be enabled as soon as the next character is transferred to the Tx shift register. These capabilities account for the largely autonomous operation of the Tx. The UART starts the above operations typically with a Tx interrupt. Logic Cells 1 490 4901 5151 5421 5071 5071 5071 5091 5091 Fmax 160 MHz 189 MHz 127 MHz 136 MHz 127 MHz 103 MHz 103 MHz 88 MHz 81 MHz 1 - FIFOs implemented in EAB's - 304 Bits Core performance in ALTERA(R) devices D16X50 UARTS FAMILY OVERVIEW D16450 D16550 D16750 - 2* 16 2* 64 * * * * * * *-Optional D16X50 family of Configurable UARTs with FIFO IP Cores All trademarks mentioned in this document are trademarks of their respective owners. Break generation and detection Prioritized interrupt system Internal diagnostic capabilities Complete status reporting False START Bit detection MODEM Control Asynchronous input buffer Separate Receiver Clock line Separate BAUD Clock line Majority voting logic FIFO Size (Bytes) FIFO Mode of operation Design UART Mode The family of DCD D16X50 UART IP Cores combine a high-performance, low cost, and small compact size, offering the best price/performance ratio in the IP Market. The DCD's Cores are dedicated for use in cost-sensitive consumer products, computer peripherals, office automation, automotive control systems, security and telecommunication applications. The D16X50 IP Cores are written in pure VHDL/VERILOG HDL languages which make them technologically independent. All of the D16X50 IP Cores can be fully customized according to customer needs. http://www.DigitalCoreDesign.com http://www.dcd.pl Copyright 1999-2003 DCD - Digital Core Design. All Rights Reserved. CONTACTS For any modification or special request please contact to Digital Core Design or local distributors. Headquarters: Wroclawska 94 41-902 Bytom, POLAND e-mail: iinnffoo@ @ddccdd..ppll tel. : +48 32 282 82 66 fax : +48 32 282 74 37 Field Office: Texas Research Park 14815 Omicron Dr. suite 100 San Antonio, TX 78245,USA USS@ @ddccdd..ppll e-mail: iinnffooU tel. : +1 210 422 8268 fax : +1 210 679 7511 Distributors: Please check hhtttpp::///w ww ww w..ddccdd..ppll//aappaarrttnn..pphhpp All trademarks mentioned in this document are trademarks of their respective owners. http://www.DigitalCoreDesign.com http://www.dcd.pl Copyright 1999-2003 DCD - Digital Core Design. All Rights Reserved.