MICRO - UART SYNTHESIZABLE UNIVERSAL ASYNCHRONOUS RECEIVER TRANSMITTER
WWW.CMOSEXOD.COM
Micro-UART
Jeung Joon Lee
4/27/2001
Recommended digital logic background: medium to
advanced
1.0 Introduction
The micro-UART is a fully functional, synthesizable,
universal asynchronous receiver transmitter core. The
core is configurable and extremely compact. A typical
synthesis will consume less than 55 flops
1
. The
receiver and the transmitter operates independently,
and each can be selectively disabled for synthesis.
Due to its modularity and configurability and size, the
micro-UART core is ideal for system-on-chip or as
embedded processor peripherals. There is no
restriction on the highest baud rate as long as the PLD
device technology can support it.
2.0 Micro-UART IP Package
Five files comprises the micro-UART core:
uart.v
u_xmit.v
u_rec.v
baud.v
inc.h
uart.v
This is the top-level hierarchy module. All sub-modules
are instantiated here. No logic is present in this
module.
u_xmit.v
This is the asynchronous transmitter. A state-machine,
serializer and support logic comprises the main bulk of
the logic.
u_rec.v
This is the asynchronous receiver. A dual-rank
synchronizer, state-machine, deserializer and support
logic comprises the bulk of the logic.
u_baud.v
This is the baud-rate generator. An internal “baud-
clock” which is 16 times the desired baud-rate is
generated off of the external clock.
inc.h
This is the configuration file. The baud-rate, external
clock rate and the size of the data-byte are all set from
this file. The clock generated from this module feeds
the u_rec and u_baud modules.
The following table describes the default port list of the
micro-UART.
Signal Width Type Description
sys_clk 1 I main system clock
sys_rst_l 1 I main system reset
uart_clk 1 O baud-clock. 16 x baud-rate
uart_XMIT_ 1 O This is the output of the
1
Results using Synplify synthesis tool.
dataH asynchronous transmitter.
xmitH 1 I An active high, 1 uart_clk
pulse starts the transmit
process.
xmit_dataH 8 I This is the data to be sent
to the remote. This data is
sampled when xmitH goes
high, so does not need to
be stable.
xmit_doneH 1 O When active high, indicates
that the xmit_dataH has
been fully transmitted.
uart_REC_
dataH
1 I This is the asynchronous
input data.
rec_dataH 8 I This is the de-serialized
received from the remote.
rec_readyH 1 O When high, indicates that a
fresh data is available on
rec_dataH
3.0 Customizing the Micro-UART IP
The micro-UART can be configured through the “inc.h”
file. Currently, 3 major parameters can be configured:
WORD_LEN
This parameter specifies the number of bits in a “word”.
The minimum is 0, and maximum is 8. The default is
8. This parameter affects both the transmitter and the
receiver.
XTAL_CLK
This parameter specifies the crystal clock feeding the
sys_clk input. This is in units of Hz.
BAUD
This parameter specifies the desired baud rate of the
micro-UART. Most typical standard baud rates are:
300, 1200, 2400, 9600, 19200, etc. However, any baud
rate can be used. This parameter affects both the
receiver and the transmitter. The default is 2400
(bauds).
CW
This parameter specifies the width of the internal
counters used to generate the appropriate baud delay.
Make sure that this value is greater than
log2(CLK_DIV). Where CLK_DIV is defined as
XTAL_CLK/(BAUD * 16 * 2). The default is 9.
4.0 UART Theory of Operation
This section illustrates the basics of a UART operation.
However, an extensive discussion on UART is beyond
the scope of this manual, and the user is encouraged
to refer to textbooks or technical manuals. Readers
familiar on this topic are encouraged to skip over to the
next section.
Figure 1 illustrates a basic UART data packet. While
no data is being transmitted, a logic 1 must be placed
in the XMIT line. A data packet is composed of 1 start
bit, which is always a logic 0, followed by a
programmable number of data bits (typically between 6
to 8), an optional parity bit, and a programmable
- 1
- 2
- 3
- 4
- 5
前往页