Beruflich Dokumente
Kultur Dokumente
dataH
xmitH
xmit_dataH
xmit_doneH
uart_REC_
dataH
rec_dataH
rec_readyH
Micro-UART
Jeung Joon Lee
4/27/2001
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 baudclock 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
1
1
1
1
uart.v
This is the top-level hierarchy module. All sub-modules
are instantiated here. No logic is present in this
module.
sys_clk
sys_rst_l
uart_clk
uart_XMIT_
asynchronous transmitter.
An active high, 1 uart_clk
pulse starts the transmit
process.
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.
When active high, indicates
that the xmit_dataH has
been fully transmitted.
This is the asynchronous
input data.
This is the de-serialized
received from the remote.
When high, indicates that a
fresh data is available on
rec_dataH
Type
I
I
O
O
Description
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.
MICRO - UART
Most UART uses 8bits for data, no parity and 1 stop bit.
Thus, it takes 10 bits to transmit a byte of data.
start bit
(logic 0)
data byte
(6 ~ 8bits)
D0 D1 D2 D3 D4 D5 D6 D7 PB
T
= 1/Baud Rate. Bit-cell period.
Tua = T/16. Oversampled bit-cell period.
SU = 2 Tua. Worce case synchronizer
uncertainty.
time
Tua =T/16
1.5T - SU
= 24Tua - 2
D0
D1
detect
start bit by sensing
transition from logic
1 to logic 0
D2
D3
D4
D5
D6
D7
PB
sample
stop bit
sample incoming data
at the bit-cell center
uart_dataH
dual-rank synchronizer
rec_datH
de-serializer
8
rec_dataH
shiftH
bit-cell
counter
received bit
counter
uart_clk
cntr_resetH
bitCell_cntrH
4
countH
rstCountH
read_bitCntrH
4
rec_readyH
State Machine
MICRO - UART
The de-serializer is a simple serial-to-parallel shitregister. It has 1 control input shiftH from the statemachine. When this signal is active high, the deserializer shifts the data over by 1 bit. The default shift
register width is 8 bits. Note that the LSB is shifted in
first.
reset
rec_datH = 0
rec_datH = 1
r_START
bitCell_CntrH != 4
r_CENTER
rec_datH = 0
bitCell_CntrH != 16
r_WAIT
r_STOP
recd_bitCntrH =
WORD_LEN
xmit_dataH
r_SAMPLE
serializer
bit-cell
counter
countEnaH
bitCell_cntrH
5
xmitted bit
counter
ena_bitCountH
rst_bitCountH
bitCountH
4
uart_xmitH
1'b1
shiftEnaH
load_shiftRegH
1'b0
2
xmitDataSelH
xmit_doneH
State Machine
xmitH
In r_CENTER state, the state-machine wait for bitcell in order to find the bit-cell center. A bit-cell is 1
baud tick and corresponds to16 uart_clk ticks. So
bit-cell corresponds to 8 uart_ticks. The bit cell
counter is used to generate this delay. The reason for
waiting for 4 uart_ticks (not 8), is that the synchronizer
uncertainty adds upto 2 uart_ticks. Additionally,
counter overhead also adds upto 2 ticks. Although it is
theoretically optimum to sample the incoming data at it
cell center, the micro-UART design allows some
margin of error (due to the fact that the data is
uart_clk
WWW.CMOSEXOD.COM
MICRO - UART
reset
xmitH == 0
x_IDLE
xmitH == 1
bitCell_cntrH != 16
x_START
bitCell_cntrH != 16
x_WAIT
bitCell_cntrH
!= 16
bitCountH ==
WORD_LEN
x_STOP
x_SHIFT
WWW.CMOSEXOD.COM
MICRO - UART
WWW.CMOSEXOD.COM
MICRO - UART
Figure 8 Close up of micro-UART tranmistting 0x76. Note that xmitH is active for 1 uart_clk tick
WWW.CMOSEXOD.COM
MICRO - UART
Figure 9 Figure 9 micro-UART receiver receiving 0x69. 1 start bit, 8 data bits, no parity 1 stop bit
WWW.CMOSEXOD.COM