Professional Documents
Culture Documents
5
UART Data Packet
The data being transmitted/received in UART serial
communication is organized into specific blocks called Packets
In the idle state, UART lines are pulled high. This allows the
receiver side to recognize that there is a transmitter device on
the other end which is connected to the serial bus.
6
UART Data Packet
• Start Bit:
- To start data transfer, the transmitting UART
pulls-down the transmission line from high to
low for one clock cycle.
- When the receiving UART module detects the
high to low voltage transition, it begins
reading the incoming bits of the entire data
frame at the same frequency of the specified
baud rate.
7
UART Data Packet
• Data Frame:
- These are the actual data bits being transmitted
from transmitter to receiver. The length of the
data frame can be anywhere between 5 and 9
(9-Bits if parity is not used and 8-Bits if parity is
used).
8
UART Data Packet
• Parity Bit:
- Parity bit allows the receiver to check the
correctness of the received data.
- Parity is a low–level error checking mechanism
and has two different options to choose from:
Even Parity and Odd Parity.
Even parity: The parity bit is a 0, the number of bits
with a value of 1 in the data frame should sum-up to
an even number.
Odd parity: The parity bit is a 1, the number of bits
with a value of 1 in the data frame should sum-up to
9
an odd number.
UART Data Packet
• Stop Bit :
- This bit is used to signal the end of the data packet
being sent.
- The sending UART drives the data transmission
line from low to high for at least two-bit durations
but most often only one bit is used.
- The data line is held high back to the idle state and
ready for any future transmission.
10
Baud Rate
• The Baud Rate specifies how fast the data is sent
over the bus and it is specified in bits-per-second
or bps.
• You can actually choose any speed for the baud
rate. However, there are some specific values that
are known to be the industry standards.
• standard baud rates include:1200, 2400, 4800,
9600,19200, 38400, 57600 and 115200.
• For a baud rate of 2400 (2400 bps) the frequency
is 2400Hz and the bit period is 1/2400 or 416.6us.
11
Baud Rate
• Baud Rate Mismatching
• The maximum allowable shift in baud rates tends
to be between (1-2%). So try to generate the exact
same baud rate at both ends to avoid mismatching
error.
12
Physical Layer Standards
13
TTL-Level UART
The majority of microcontroller chips with UART serial
communication modules do use TTL (Transistor-transistor
Logic) level UART.
14
RS-232 UART
RS-232 (Recommended Standard 232) is a standard for serial
binary data signals connecting between a Data Terminal
Equipment (DTE) and a Data Communication Equipment (DCE)
Logic Level Logic-1 (High) Logic-0 (Low)
Voltage +3 to +15v -3 to -15v
15
RS-232 UART
16
UART Bus Length VS Baud
Rate
17
PC Interfacing With Microcontroller
(PC-MCU interface)
1. TTL-UART to RS-232 Serial
18
Max 232 Pin Diagram and
Circuit Diagram
19
Features of Max232 IC
• Input supply voltage of 5V.
• Input voltage levels compatible with TTL
standard.
• Output voltage levels compatible with RS 232
standard.
• Low input current of 0.1microAmpere and
output current of 24mA.
• It operates in a temperature range of -40
degree Celsius to +85 degree Celsius
20
Advantages Of UART Serial
Communication
• Only two wires are required for a full-duplex data
transmission (excluding the power lines).
• The structure of the data packet can be
changed with coordination between both ends.
• No need for a serial clock signal (in asynchronous
mode).
• Parity bit provides a hardware-level error
detection.
• Well-documented and widely-used protocol.
• Relatively easy to set-up and run.
21
Disadvantages Of UART Serial
Communication
• Speed for data transfer is less compared to
parallel communication or even USARTs.
• The baud rates of each UART must be the
same in both sides.
• The size of the data frame is limited to a
maximum value of 9-Bits.
• Doesn’t support multiple slaves or multiple
masters capability.