unit 4 ES
unit 4 ES
Serial communication is a method of transmitting data bit by bit sequentially over a communication
channel or data bus. Unlike parallel communication, which sends multiple bits at once, serial
communication sends one bit at a time, making it simpler and cheaper in terms of wiring.
Serial communication can be of two types based on the synchronization technique used:
1. Synchronous Communication
2. Asynchronous Communication
Synchronous Communication
Synchronous communication is a data transmission method where both the sender and receiver
operate in perfect timing using a shared clock signal. This synchronization ensures accurate and
continuous data exchange, making it ideal for high-speed, timing-sensitive communication. Data is
sent in blocks or frames, with each bit aligned to clock pulses. The sender transmits bits in sync with
the clock, while the receiver samples them at the same rate, enabling efficient, reliable, and full-
duplex transmission.
In synchronous communication, the sender and receiver share a common clock to maintain precise
timing. Data is transmitted in a continuous stream without start or stop bits, and synchronization is
maintained at the bit level. This enables faster and more efficient data transfer, especially for large
volumes.
How It Works:
There are two main methods for managing the clock signal:
• Separate Clock Line: A dedicated wire carries the clock signal alongside data (e.g., in SPI
communication).
• Embedded Clock: The clock is integrated into the data stream using encoding techniques like
Manchester coding, as seen in protocols such as HDLC and USB.
This tight synchronization ensures accurate and high-speed communication between devices.
Unlike asynchronous communication (which uses start/stop bits), synchronous communication sends
continuous data without framing each byte. The data is grouped into frames, which may contain:
Advantages
• High Speed: Since there's no start/stop bit per byte, more data can be transmitted in less
time.
• Efficiency: Better bandwidth utilization.
• Low Latency: Ideal for systems requiring low communication delays.
• Good for Large Transfers: Best for large blocks of data like audio/video streaming, memory
transfers.
Disadvantages
Asynchronous Communication:
Asynchronous communication is a type of serial transmission where data is sent one byte or
character at a time without a shared clock between the sender and receiver. Instead, each byte is
framed with control bits to mark its beginning and end, allowing independent and intermittent data
transfer.
Instead of synchronizing every bit with a clock signal, the sender adds control bits (start, stop, and
sometimes parity bits) around each data byte to help the receiver identify when data transmission
starts and ends.
This half-duplex transmission method is simple, flexible, and ideal for scenarios where data is sent
occasionally rather than continuously.
Asynchronous transmission is like sending individual text messages without knowing exactly when
the other person will read them.
How Asynchronous Communication Works:
In asynchronous communication, the sender and receiver first agree on a common baud rate (bits
per second) to ensure consistent timing. When idle, the communication line remains at a logic HIGH
level.
Transmission Process:
1. Start Bit: Communication begins when the sender pulls the line LOW to indicate the start of
a new data frame.
2. Data Bits: Typically, 5 to 9 bits representing the actual character.
3. Optional Parity Bit: Used for basic error checking.
4. Stop Bit(s): One or more bits set too HIGH to signal the end of the data frame.
The receiver detects the start bit, then uses an internal clock to sample each bit at expected
intervals. After reading the data, the optional parity bit, and the stop bit(s), the receiver
resynchronizes and waits for the next start bit. This method allows byte-by-byte transmission
without continuous clock synchronization.
• 8 Data bits
• No Parity
• 1 Stop bit
Advantages
Disadvantages
It is built into most microcontrollers and PCs and is one of the simplest and most commonly used
communication protocols in embedded systems.
Purpose of UART
UART converts parallel data from the CPU into serial form for transmission and serial data from
receiver into parallel form for processing. It allows full-duplex communication using only two main
lines:
• Tx (Transmit)
• Rx (Receive)
Functions of UART:
• Baud Rate Generator: Determines the transmission speed.
• Transmit Buffer (Tx): Temporarily holds data before sending.
• Receive Buffer (Rx): Collects incoming data.
• Parity Generator/Checker: For basic error checking.
Applications of UART
• Microcontroller to PC communication
• Bluetooth/GSM/GPS modules
• Debugging using Serial Monitors (e.g., Arduino Serial Monitor)
• Bootloaders for firmware flashing
• Sensor communication in IoT systems
Advantages
It provides reliable, error-free data transfer by using framing, error checking, and flow control.
Key Characteristics
• Flag − It is an 8-bit sequence that marks the beginning and the end of the frame. The bit
pattern of the flag is 01111110.
• Address − It contains the address of the receiver. If the frame is sent by the primary station,
it contains the address(es) of the secondary station(s). If it is sent by the secondary station, it
contains the address of the primary station. The address field may be from 1 byte to several
bytes.
• Payload − This carries the data from the network layer. Its length may vary from one network
to another.
• FCS − It is a 2 byte or 4 bytes frame check sequence for error detection. The standard code
used is CRC (cyclic redundancy code)
Types of HDLC Frames
1. Information Frames (I-frames): I-frames or Information frames carry user data from the
network layer. They also include flow and error control information that is piggybacked on
user data. The first bit of control field of I-frame is 0.
o It may contain an information field, if required. The first two bits of control
field of U-frame is 11.
o Carry commands and responses such as:
These frames together ensure reliable, controlled, and structured communication between HDLC-
connected devices.
Bit Stuffing (Transparency Technique)
• HDLC uses a flag 01111110 to mark the start and end of a frame.
• To prevent this flag from accidentally appearing in data, HDLC uses bit stuffing.
Example:
Original data: 01111110 → Stuffed: 011111010
1. Framing: The sender formats the data into HDLC frames, adding control fields.
2. CRC and Flag Bits: A CRC is added for error detection, and flag bits (01111110) are placed at
the beginning and end of each frame.
4. Reception and Validation: The receiver detects the flag bits, extracts the frame, and
validates it using the CRC.
1. CRC Check: Errors are detected using Cyclic Redundancy Check (CRC) included in the Frame
Check Sequence (FCS) field.
Advantages of HDLC
Disadvantages of HDLC
Complex Frame Processing: Requires more logic for handling framing, control, and error checks.
Bit Stuffing Overhead: Increases data size and processing time when many '1's occur in data.
Inefficient for Small Data Packets: Frame structure and overhead make it less suitable for short
or infrequent transmissions.
WAN Protocols: Forms the basis for protocols like Frame Relay, ISDN, X.25, and PPP (which uses
HDLC-like framing).
Telecommunications: Used in satellite links and router-to-router communications for reliable
synchronous transmission.
Embedded Systems: Ideal for synchronous serial communication in microcontroller-based
systems.
Point-to-Point Communication: Ensures efficient and error-checked data transfer between two
devices.
Multipoint Networks: Supports communication across multiple devices sharing a common
channel.
Key Features
5. Example Devices: Commonly used with printers, scanners, and external storage devices.
High-Speed Transfer: Allows fast data transfer by sending multiple bits simultaneously — ideal
for bulk data.
Easy Microcontroller Integration: Simple and effective for interfacing with microcontrollers in
embedded systems.
Device Compatibility: Well-suited for connecting printers, scanners, and other parallel-interface
peripherals.
Short Range: Effective only over short distances due to signal degradation.
Bulky Setup: Requires thick, multi-wire cables, making it less compact.
Obsolete Technology: Largely replaced by USB and other modern interfaces in current systems.