Professional Documents
Culture Documents
PROJECT OBJECTIVE:
PIN DIAGRAM:
clk
BR_clk
dtr
rst
rts
cs
wr Txd_
u
rd intr
3
add 8 Dout_u
cts
dsr UART
Rxd_
u_
Din_u 8
PIN DESCRIPTION :
bclk
rst
Clk_en txd
Data_ready
Parity_en
busy
Odd_even
Stop_b TRANSMITTER
Num_bits 2
din 8
Bclk16
Data_rcvd
rst
Frame_err
Clk_en
Par_en Par_err
RECEIVER
Odd_even
Num_bits 8 D_out
Stop_b
PIN DESCRIPTION OF RECEIVER:
PIN PIN PIN DIRECTION
DIRECTION
Bclk16 In Clock equal to the 16Xbaud rate
generator
Rst In Asynchronous reset, active high
Clk_en In A clock enable
Par_en In Parity enable
Odd_even In ‘1’- parity need to check for
even parity
‘0’- parity need to check for odd
parity
Stop_b In ‘0’- stop bits to receive is one
‘1’ –stop bits need to receive is
two
Num_bits In(1:0) The number of data transfer will
be
5,6,7,or 8 when 00,01,10,11
respectively
Data_rcvd Out Received data byte ready line
Frame_err ‘1’- the received stop bit is
wrong
‘0’- the received stop bit is right
Par_err Out The received parity bit is wrong
Dout_u Out (7:0) The output data
Ts
T – 1 / baud rate.
Ts – T/16. Sampling incoming data
Bit center.
BLOCK DESCRIPTION:
Bclkx
8
Receiver
Line status control
register logic
Line
control
register
Serial to Rxd
parallel
Rx_FIFO converter
Transmitter
FIFO control
control logic
register bclk
txd
Parallel to
TX FIFO serial
converter
Interrupt
enable IntR
register
Interrupt
control
Interrupt logic
identificati
on register
RTS
Modem
status DSR
register
DTR
Modem CTS
signal logic
Modem
control
register
The baud rate generator takes the baud rate clock (BR_clk) from
crystal. And produces the clocks for the transmitter (Bclk) and receiver (BclkX16)
by dividing the baud rate clock by divisor values which depending on the desired
baud rate.
Baud rate divisor value = freq of baud rate clk(BR_clk)/ desired baud rate X 16
TRANSMITTER BLOCK:
The input clock to the transmitter is equal to the baud rate (Bclk). The TX will transmit the
data at desired baud rate. First the transmitter is in the idle state. In the idle state it will
send the 1’s. When the serial device is ready to receive the data the processor send the
data to the buffer at its frequency. When at least one byte is available in the buffer it makes
the data ready high, first it sends the start bit, after the byte goes to the parallel to shift
register. the shift register shifts the data out at baud rate. If the parity enable bit is high, the
parity bit is also transmits after the MSB of data depending on the odd –or-even control.
After the parity one or two stop bits will transmit. When the buffer is empty it will send the
interrupt by making making the status register bit 0 high.
RECEIVER BLOCK:
When the one byte received completely it makes the data_rcvd output high. And
then this byte will go to the Rx buffer and simultaneously the status of par_err
and frame _err will store in the MSB bits of the Rx buffer. If the Rx buffer is
already full the byte in the shift register will overwrite by the next byte. This is the
overrun error.
REGISTERS DESCRIPTION:
0 0 0 RX_FIFO RX_FIFO
0 0 1 IER
0 1 0 IIR FCR
0 1 1 LCR
1 0 0 MCR
1 0 1 LSR
1 1 0 MSR
This register is used to enable or disable the interrupts (rx_fifo, tx_fifo, line
status, modem status interrupts) at the start of communication. The interrupts
will generate when the corresponding interrupt enable bit in this register
high.
2. INTERRUPT IDENTIFICATION REGISTER:
This register is used to set the format for communication at the start of
communication. This will set by the processor. It will tell about how data
width that will be decided by the num_bits, the parity is enabled or not, if
enabled it is even parity or odd parity and how many stop bots need to
transmits depending on the stop_b bit.
TEST STRATEGY:
In the test bench loop back is provided from the transmitter serial
output to the receiver serial Input. For the testing the system clock and
baud rate generator clock are same.
Step 1.
Assert the reset (RST) and system clock (CLK) and baud rate clock
(BR_CLK),
• Initialize the all registers to specific contents.
• Reset the contents of TX & Rx FIFO’s.
• Disable the all interrupts.
Step 2.
Deassert the RST to for proper operation of uart (RST=’0’) and WR=’1’.
• Set the ADD =”011”set the contents of LCR for specific communication
format.
• Set the ADD=”001”Enable the interrupts by making the IER contents to
high.
• Set the ADD=”100”Set the contents of MCR to enable the
communication by asserting DTR and RTS.
• Set the ADD=”010”Set the FIFO trigger level by initializing the FCR.
Step 3.
Assert the serial device hand shake signals to start the communication
CTS<=‘1’, DSR<=’1’;
Whenever the TX FIFO is empty, set the ADD=”000” for writing the data
to TX_FIFO.
Step 4.
Step 5.
Whenever there is high on the interrupt set the ADD=”010” to read the
contents of IIR.
And set the ADD=”101” to read the contents of LSR.
Step 6:
SYNTHESIS REPORT:
DEVICE UTILIZATION:
*******************************************************
*******************************************************
Number of ports : 32
Number of nets : 428
Number of instances : 387
Number of references to this view : 0
***********************************************
Device Utilization for 2V250fg256
***********************************************
Resource Used Avail Utilization
-----------------------------------------------
IOs 32 172 18.60%
Function Generators 176 3072 5.73%
CLB Slices 88 1536 5.73%
Dffs or Latches 124 3588 3.46%
-----------------------------------------------
TIMING REPORT:
Clock : Frequency
------------------------------------