Professional Documents
Culture Documents
2 Uart Miniproject Compress
2 Uart Miniproject Compress
Bachelor of Technology
Technology
in
BY
R.Swathi 08QR1A0449
N.Srilatha 08QR1A0440
Under the guidance of
Y.Ramakrishna
ENGINEERING
ENGINEERING SCIENCES (KPSW)
ENGINEERING SCIENCES
This is a Mini Project report work carried out by me under the guidance of ,
Y.Rama krishna H.O.D Professor of of ECE Department and the results embodied
in this project have not been reproduced or copied from any source. The results
embodied in this project have not been submitted to any other University or
.
DEPARTMENT OF ELECTRONICS AND COMUNICATIONS ENGINEERING
ENGINEERING SCIENCES
CERTIFICATE
submitted in partial fulfillment of the requirements for the award of the degree
ENGINEERING
The results of investigations enclosed in this report have been Verified and found
Satisfactory. The results embodied in this project have not been submitted to any
other University or Institute for the award of any other Degree or Diploma .
External Examiner
ACKNOWLEDGEMENTS
First and foremost, we express our sincere thanks for the guidance and encouragement
ENGINEERING SCIENCES, Shabad. We extend our gratitude for his advice and guidance during the
We wish to express our profound thanks to our Director- Academics Dr. K.S.R.K. Prasad ,
KITE, Shabad, for providing necessary facilities to make t his mini-project a success.
We thank all the members of Teaching Staff members, and also who have assisted us directly or
Finally, we would like to express our sincere gratitude to our Parents who are constantly encouraging us
ABSTRACT
Serial communications is the process of sending data one bit at one time,
sequentially, over a communication channel or computer bus. Serial
communications is used for all long haul communications and most computer
networks, where the cost of cable and synchronization difficulties make parallel
communications impractical. Serial transmission is commonly used with modems
and for non-networked communication between computers, terminals and other
devices. The Universal Asynchronous Receiver/Transmitter (UART) controller is
the key component of the serial communications subsystem of a computer. The
UART takes bytes of data and transmits the individual bits in a sequential fashion.
At the destination, a second UART re-assembles the bits into complete bytes.
Introduction
The CPU communicates with the UART by reading or writing one of eight bytes
called ports. A computer system normally has more than one UART, so the port
addresses depend on the particular UART being accessed. Each UART is
associated with a different base address, and a particular port is specified by adding
a specific index to that base address. The index for a particular port is independent
of the UART, so we can characterize the ports by indices 0 through 7.
A modem is composed of two basic parts, the UART and the analog modulator-
demodulator,which is where the term (Modem) comes from. During transmission
of data the UART is responsible for taking the data from the host machine and
turning it into a serial bit stream that can be sent by the modem over the phone
line. During reception of data the UART takes the serial data from the modem and
converts it into parallel data that can be used by the host machine.
The parallel side of a UART's usually connected to the bus of a computer. When
the computer writes a byte to the UART's transmit data register (TDR), the UARTs
will start to transmit it on the serial line. The UART's status register contains a flag
bit which the computer can read to see if the UART is ready to transmit another
byte. Another status register bit says whether the UART has received a byte from
the serial line, in which case the computer should read it from the receive data
register (RDR).
The UART's serial connections usually go via separate line driver and line receiver
integrated circuits which provide the power and voltages required to drive the
serial line and give some protection against noise on the line.
Data on the serial line is formatted by the UART according to the setting of the
UART's control register. This may also determine the transmit and receive baud
rates if the UART contains its own clock circuits or "baud rate generators".
UART is the most commonly used host controller interface because of following
reasons:
2.Interface of UART:A UART acts as the interface between an I/O bus and a
serial device, such as a mouse or modem, which communicate with a computer one
bit at a time. On a PC, there are two UARTs that connect to the COM1 and COM2
ports on the back of the computer.
3.The job of a UART is to accept bytes of data from the CPU 8 bits at a time
(in parallel) and to transmit them one bit at a time (serially) to whatever device is
plugged into its connector on the back of the computer. At the same time, it
Transmitting and receiving serial data
Since the UART is asynchronous in working, the receiver does not know when the
data will come, so receiver generate local clock in order to synchronize to
transmitter whenever start bit is received.
The UART usually does not directly generate or receive the external signals used
between different items of equipment. Separate interface devices are used to
convert the logic level signals of the UART to and from the external signaling
levels. External signals may be of many different forms. Examples of standards for
voltage signaling are RS-232, RS-422 and RS-485 from the EIA. Historically,
current (in current loops) was used in telegraph circuits. Some signaling schemes
do not use electrical wires. Examples of such are optical fiber, IrDA (infrared), and
(wireless) Bluetooth in its Serial Port Profile (SPP). Some signaling schemes use
modulation of a carrier signal (with or without wires). Examples are modulation of
audio signals with phone line modems, RF modulation with data radios, and the
DC-LIN for power line communication.
Communication may be "full duplex" (both send and receive at the same time) or
"half duplex" (devices take turns transmitting and receiving).
Character framing
Each character is sent as a logic low start bit, a configurable number of data bits
(usually 7 or 8, sometimes 5), an optional parity bit, and one or more logic high
stop bits. The start bit signals the receiver that a new character is coming. The next
five to eight bits, depending on the code set employed, represent the character.
Following the data bits may be a parity bit. The next one or two bits are always in
the mark (logic high, i.e., '1') condition and called the stop bit(s). They signal the
receiver that the character is completed. Since the start bit is logic low (0) and the
stop bit is logic high (1) then there is always a clear demarcation between the
previous character and the next one.
Asynchronous Serial Transmission:
When a word is given to the UART for Asynchronous transmissions, a bit called
the "Start Bit" is added to the beginning of each word that is to be transmitted. The
Start Bit is used to alert the receiver that a word of data is about to be sent, and to
force the clock in the receiver into synchronization with the clock in the
transmitter. These two clocks must be accurate enough to not have the frequency
drift by more than 10% during the transmission of the remaining bits in the word.
(This requirement was set in the days of mechanical teleprinters and is easily met
by modern electronic equipment.)
After the Start Bit, the individual bits of the word of data are sent, with the Least
Significant Bit (LSB) being sent first. Each bit in the transmission is transmitted
for exactly the same amount of time as all of the other bits, and the receiver
``looks'' at the wire at approximately halfway through the period assigned to each
bit to determine if the bit is a 1 or a 0. For example, if it takes two seconds to send
each bit, the receiver will examine the signal to determine if it is a 1 or a 0 after
one second has passed, then it will wait two seconds and then examine the value of
the next bit, and so on.The sender does not know when the receiver has ``looked''
at the value of the bit. The sender only knows when the clock says to begin
transmitting the next bit of the word.
When the entire data word has been sent, the transmitter may add a Parity Bit that
the transmitter generates. The Parity Bit may be used by the receiver to perform
simple error checking. Then at least one Stop Bit is sent by the transmitter.
When the receiver has received all of the bits in the data word, it may check for the
Parity Bits (both sender and receiver must agree on whether a Parity Bit is to be
used), and then the receiver looks for a Stop Bit. If the Stop Bit does not appear
when it is supposed to, the UART considers the entire word to be garbled and will
report a Framing Error to the host processor when the data word is read. The usual
cause of a Framing Error is that the sender and receiver clocks were not running at
the same speed, or that the signal was interrupted.
Regardless of whether the data was received correctly or not, the UART
automatically discards the Start, Parity and Stop bits. If the sender and receiver are
configured identically, these bits are not passed to the host.
If another word is ready for transmission, the Start Bit for the new word can be
sent as soon as the Stop Bit for the previous word has been sent.Because
asynchronous data is “self synchronizing”, if there is no data to transmit, the
transmission line can be idle.
Advantages Disadvantages
Handshaking actions with the attached device are accomplished by the Modem
Control Register (MCR). In the UART series 16550, setting and resetting of the
control signals must be done by software. But in the new 16750, flow control
automatically handled.
The Line Status Register (LSR) shows the current state of communication. Errors,
the state of the receiver and transmit buffers are available.
The Modem Status Register (MSR) contains information about the four incoming
modem control lines on the device. The four most significant bits contain
information about the current state of the inputs. The least four significant bits are
used to indicate state changes. Each time the register is read the four LSB's are
reset.
In addition to the basic job of converting data from parallel to serial for
transmission and from serial to parallel on reception, a UART will usually
provide additional circuits for signals
That signals can be used to indicate the state of the transmission media, and
to regulate the flow of data in the event that the remote device is not
prepared to accept more data.
Example:
• When the device connected to the UART is a modem, the modem may
report the presence of a carrier on the phone line while the computer may be
able to instruct the modem to reset itself or to not take calls by raising or
lowering one more of these extra signals.
• The function of each of these additional signals is defined in the EIA RS232-
C standard.
UART Errors
Overrun Error:
An "overrun error" occurs when the UART cannot process the byte that just came
in before the next one arrives. The host processor must service the UART in order
to remove characters from the buffer. If the host processor does not service the
UART and the buffer becomes full, then Overrun Error will occur.
Framing Error:
A "Framing Error" occurs when the designated "start" and "stop" bits are not valid.
Start bit acts as a reference for the remaining bits. When the "stop" bit is expected
if the data line is not in the expected idle state a Framing Error will occur.
Parity Error:
A "Parity Error" occurs when the number of "active" bits does not agree with the
specified parity configuration of the UART.
Underrun error:
In "underrun error" occurs when the UART transmitter has completed sending
character and the transmit buffer is empty. In asynchronous modes this is treated as
an indication that no data remains to be transmitted, rather than an error, since
additional stop bits can be appended. This error indication is commonly found in
USARTs, since an underrun is more serious in synchronous systems.
Types of UARTS
8250
The first UART in this line. It doesn't contain any scratch registers. 8250A is a
modernized version of 8250, its bus operating speed is very fast.
8250A
The bus operating speed of this UART is greater than 8250's. It is used in the
same way as 16450 in the sphere of software.
8250B
16450
Used in AT's (Improved bus speed over 8250's). Works stable at 38.4KBPS.
Widespread today.
16550
This line is the first generation of buffered UART. This line has 16-byte buffer,
however it doesn't work and is replaced with the 16550A.
16550A
This line is the most widespread UART version used for high-speed connection of
modems with 14.4KBPS and 28.8KBPS rates. They made sure the FIFO buffers
worked on this UART.
16650
UART Receiver RCV_shftreg
Serial_in
RCV_datareg
RECEIVER D
a
Read_not_ready_in CONTROLLER t
a
Read_not_ready_out
B
Error1
u
Error2 s
To / From
Sys_Clock Sample_clk Host
UART Clock
Reset_ Clock
Generator
Bit_count
start
Load_XMT_shftreg
XMT_shiftreg
Serial_out 1
Load_XMT_datareg
XMT_datareg
Uart_transmitter_arch
Transmitter start
Load_XMT_datareg
Clear
T_BYTE
Controller
The state machine of the controller forms the following output signals that
Read_not_ready_in
Clr_Sample_Counter
UART Inc_Bit_counter
Clr_Bit_Counter
Serial_in Receiver
Inc_Sample_Counter
Datapath
shift
Controller
Sample_Count
load
Error1
Bit_Counter Error2
next_state = idle;
clr_Sample_counter = 1;
end else
next_state = receiving
clr_Sample_counter = 1;
else begin
clr_Sample_counter = 1;
if(Bit_counter ! =word_size)begin
shift = 1;
inc_Bit_counter = 1;
end
else begin
next_state = idle;
read_not_ready_out = 1;
clr_Bit_counter = 1;
if(read_not_ready_in == 1) Error1 = 1;
else load = 1;
end
end
endcase
end
Sample_counter <= 0;
Bit_counter <= 0;
RCV_datareg <= 0;
RCV_shftreg <= 0;
end
else begin
end
end
endmodule
APPLICATIONS OF UART :
2. Modem interface
References
2. www.edaboard.com
3. www.classle.net/projects/project_ideas
4. www.scribd.com
5.www.asic-world.com
6.www.vlsi.com
7.projectsuniversal.in
8.only-vlsi.blogspot.com
9.www.thesatya.com
10.en.pudn.com