🔌 Serial Communication

📡 Serial Communication

Serial communication is a method of data transfer where information is transmitted one bit at a time over a single communication path. This approach contrasts with parallel communication, where multiple bits are sent simultaneously across multiple channels.

Key Concepts

🔄 Sequential Transfer

Data bits transmitted one after another in sequence

📋 Protocol-Based

Requires specific protocols to manage communication

🎯 Reliable Transmission

Ensures data integrity through structured procedures

🔗 Single Path

Uses one communication channel for bidirectional data

Protocol Categories

Character-Oriented Protocol

Uses special control characters to structure and manage data frames

Transmission Example

Practical demonstration of protocol implementation in action

Data Transparency

Techniques to prevent data misinterpretation as control commands

Bit-Oriented Protocol

Efficient alternative using flag sequences instead of characters

📝 Character-Oriented Protocol

Character-oriented protocols use specific control characters embedded within the data stream to define the structure and boundaries of transmitted data frames.

Frame Structure

[ HEADER ] → [ DATA FIELD ] → [ TRAILER ]
SYN STX DATA... ETX BCC

ASCII Control Characters

Character Function Purpose
SYN Synchronization Establishes and maintains synchronization between sender and receiver
STX Start of Text Marks the beginning of the data field
ETX End of Text Marks the end of the data field
DLE Data Link Escape Used for achieving data transparency
BCC Block Check Character Error detection code for the frame

Transmission Example

A typical transmission sequence demonstrates how control and data characters are combined:

Sample Transmission Sequence:
1. SYN SYN - Establish synchronization
2. STX - Begin data transmission
3. H E L L O - Actual data
4. ETX - End of data
5. BCC - Error check code

⚠️ Data Transparency Issue

Problem: If the actual data contains bit patterns identical to control characters, the receiver may misinterpret data as control commands.

Solution: Use character escaping techniques with DLE (Data Link Escape) to distinguish control characters from data that looks like control characters.

Example: If data contains ETX, transmit as DLE ETX to indicate it's data, not a control command.

⚡ Bit-Oriented Protocol

Bit-oriented protocols provide a more efficient alternative to character-oriented methods by using unique flag sequences to delimit frames rather than relying on 8-bit control characters.

Key Features

🚩 Flag Sequence

Unique bit pattern (e.g., 01111110) marks frame boundaries

🔧 Bit Stuffing

Hardware-level technique for data transparency

⚡ Higher Efficiency

Better suited for high-speed communications

✅ Inherent Transparency

No character escaping needed

Frame Structure

Typical BOP Frame Format (e.g., HDLC):
01111110 FLAG
ADDRESS Destination address
CONTROL Frame type and sequence
INFORMATION Actual data payload
FCS Frame Check Sequence
01111110 FLAG

✨ Bit Stuffing Mechanism

Purpose: Prevents data from accidentally containing the flag sequence (01111110)

Method: When transmitting data, if five consecutive 1s appear, automatically insert a 0. The receiver removes these stuffed bits.

Example:

Original: 0111111010
Stuffed: 0111110010 ← Zero inserted

Advantages Over Character-Oriented

  • 🎯 True Data Transparency: Hardware bit stuffing handles any data pattern automatically
  • ⚡ Higher Efficiency: Less overhead compared to character-based escaping
  • 🔄 Better Performance: Optimized for high-speed link control
  • 🛠️ Simpler Implementation: No need for complex character interpretation logic

⚖️ Protocol Comparison

Aspect Character-Oriented Protocol Bit-Oriented Protocol
Frame Delimiter 8-bit ASCII control characters (STX, ETX) Unique flag bit sequence (01111110)
Data Transparency Character escaping with DLE Hardware bit stuffing/destuffing
Efficiency Lower (character-based overhead) Higher (bit-level processing)
Implementation Software-intensive Hardware-optimized
Speed Suitable for moderate speeds Optimized for high-speed links
Complexity Simpler conceptually More complex but more efficient
Use Cases Legacy systems, text-based communication Modern networks, high-speed data transfer
Start Learning Memory Organization