0% found this document useful (0 votes)
2 views

Serial Protocols

The document provides an overview of various serial protocols including I2C, CAN, Firewire, and USB, detailing their characteristics, communication methods, and applications. I2C is a master-slave protocol for short-distance communication, CAN is designed for real-time communication in embedded systems, Firewire supports high-speed data transfer without a host controller, and USB is a versatile standard for connecting peripherals. Each protocol has unique features that cater to specific needs in data transmission and device connectivity.

Uploaded by

AndIs Paudel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Serial Protocols

The document provides an overview of various serial protocols including I2C, CAN, Firewire, and USB, detailing their characteristics, communication methods, and applications. I2C is a master-slave protocol for short-distance communication, CAN is designed for real-time communication in embedded systems, Firewire supports high-speed data transfer without a host controller, and USB is a versatile standard for connecting peripherals. Each protocol has unique features that cater to specific needs in data transmission and device connectivity.

Uploaded by

AndIs Paudel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

SERIAL

PROTOCOLS
I2C, CAN, Firewire, USB

Abhishek Pachhain 078BEI001


Amit Acharya 078BEI002
Andis Paudel 078BEI003
Anurag Sah 078BEI004
1
I2C
Inter-integrated Circuit (I2C )
Developed in 1982 by Philips (now NXP)
Very common
Primarily used for short distance data communications
Synchronous master - slave protocol
Both master and slaves can send/receive data
Bidirectional, half duplex
Can run at different speeds
Two wires: serial clock (SCL) and serial data (SDA)
2
I2C TOPOLOGY
3
I2C FRAMES
4
START CONDITION
In the idle state SDA and SCL are both high
The start condition occurs when a node
First pulls SDA low
Then pulls SCL low
This "claims the bus"
The node is now the master
Prevents any other nodes from taking control
of the bus
Reduces the risk of contention
The master who has seized the bus also starts the
clock
SLAVE ADDRESS 5

Each I2C node on a bus must have a unique, fixed


address
Normally 7 bits long, MSB first
10-bit addresses are also supported but are
uncommon
Addresses may be hard coded or using jumper
wires and lines.
TIMING OF SCL AND SDA 6

SDA does not change between the Clock rising edge and the Clock falling
edge
During data transmission, SDA only transitions while SCL is low
An SDA transition when SCL is high, indicates a start or stop condition
7
READ WRITE BIT
Read/write bit follows the slave address
Set by master to indicate desired operation
O: master wants to write data to slave
1: master wants to read data from slave
Often interpreted and/or decoded as part of
the address byte
8
ACKNOWLEDGE BIT
Sent by the receiver of a byte of data:
0 – Acknowledgement (ACK)
1 – Negative Acknowledgement (NACK)
I2C is idle high.
Lack of response = NACK
Used after the slave address and each data
byte:
ACK after data byte(s) confirms receipt of data.
ACK after slave address confirms:
A slave with that address is on the bus.
The slave is ready to read/write data
(depending on R/W bit).
9
DATA BYTES
Data byte contains the information being
transferred between master and slave
Memory or register contents, addresses, etc.
Always 8 bit long. MSB first
Always followed by an
acknowledgement bit
Set to zero by the receiver if data has been
received properly
10
MULTIPLE DATABYTES
In many cases, multiple data bytes are sent in one I2C frame
Each data byte is followed by an ACK bit
Bytes may be all "data," or some may represent an internal address, etc,
Ex: first byte is a register location and second byte is the data to be written to that
register
11
STOP CONDITION
Stop condition indicates the end of data bytes
First, SCL returns (and remains) high
Then, SDA returns (and remains) high
Note that for data bytes, SDA only transitions
when the clock is low
SDA transition when SCL high = stop condition
Bus becomes idle
-No clock signal
Any node can now use the start condition to
claim the bus and begin a new
communication
12
SUMMARY
I2C Protocol: Widely used for short-distance data
exchange (intra-board).
Two Wires: Serial Data (SDA) and Serial Clock (SCL).
Master Control: Master controls the bus, reads/writes a
frame with a Slave address and data bytes.
Acknowledgement: Each address and data byte is
acknowledged.
Start/Stop Conditions: Communication is initiated and
terminated with special conditions.
Idle State: I2C is idle high (open drain).
Bus Speeds: Supports various maximum bus speeds.
13
INTRODUCTION TO CAN
What is CAN?
Controller Area Network (CAN) is a serial communication protocol designed for real-time, reliable
communication between multiple embedded systems.
Initially developed by Bosch for automotive applications, CAN is now widely used in industries such as
automobiles, robotics, medical devices, and industrial automation.

Where is CAN used?


Automotive Systems: Communication between components like ECUs, sensors, actuators, brake
systems, etc.
Industrial Automation: Robots, manufacturing, and process control.
Aerospace and Medical: Communication in critical systems requiring high reliability and noise
immunity.
14
CAN
The CAN bus consists of two lines: CANH (High) and CANL (Low). Data is transmitted using differential signaling,
which improves noise immunity.
Recessive State (1): CANH and CANL are at the same voltage.
Dominant State (0): CANH is higher, CANL is lower.
CHARACTERISTICS OF CAN
Serial Communication
The CAN bus uses serial communication to transfer data between nodes. Messages are transmitted bit by
bit over a two-wire differential bus, ensuring reliable long-distance communication even in electrically
noisy environments.
Noise Immunity:
Uses differential voltage to communicate, where the bit value is determined by the voltage
difference between CANH and CANL.
This approach makes it resistant to electrical noise that could corrupt signals in other systems
relying on single-wire systems.

Error Detection and Fault Tolerance:


CRC (Cyclic Redundancy Check) for error detection, along with mechanisms like bit stuffing
and acknowledgement to ensure the message integrity.
15
CHARACTERISTICS OF CAN
Bus Topology:
CAN network uses a bus topology, meaning all devices are connected to a shared pair of wires (CANH and
CANL).
Devices (nodes) are connected in parallel to the bus, and the message is broadcasted to all devices in the
network.
Asynchronous Communication:
CAN allows asynchronous communication, meaning no global clock is required. Devices on the
network operate with their own clocks but must ensure they operate at the same baud rate for
successful communication.
Arbitration:
When multiple devices try to transmit simultaneously, arbitration occurs. The device with the lower
identifier gets the bus access first, ensuring priority-based transmission without any collisions.
16
CAN DATA FRAME
CAN Data Frame:
The Data Frame is the most common type of frame used in CAN for communication.
The frame is composed of several fields:
a. Start of Frame (SOF): 1 bit indicating the start.
b. Identifier (ID): 11 bits (or 29 bits in extended mode).
c. Control Field: 6 bits — indicates the number of data bytes.
d. Data Field: 0-8 bytes — the actual data being transmitted.
e. CRC: 15 bits — for error detection.
f. ACK: 2 bits — indicates that the message was received correctly.
g. End of Frame (EOF): 7 bits marking the end.
17
SUMMARY AND KEY TAKEAWAYS
CAN is a highly reliable, noise-resistant communication protocol widely used in embedded
systems, especially in automotive and industrial applications.
The differential voltage approach ensures that CAN maintains communication integrity even in
electrically noisy environments.
The data frame structure and bit stuffing mechanisms provide error-checking and ensure efficient
data transmission.
Real-time communication with arbitration and priority-based transmission makes CAN a critical
part of systems requiring time-sensitive and reliable data exchange.
IEEE 1394 18

High-Speed Serial Bus Standard: Designed for fast communication and isochronous real-time data
transfer.
Developed by Apple: First integrated into Macintosh computers in 1999.
Brand Names:
FireWire (Apple, copyrighted)
i.LINK (Sony, used in cameras/camcorders)
Connector Types:
4-pin (Sony): Compact, 4 signal conductors, used in consumer electronics.
6-pin & 9-pin (Apple): More robust, used in computers and peripherals.
Performance: Traditionally faster than USB 2.0 for data transfer.
Replaced By: Thunderbolt (2011) and USB 3.0.
Last Mac with FireWire: 2016.
19
WHY FIREWIRE?
No Host Controller Required: Unlike USB, which follows a master-slave model, FireWire allows
peer-to-peer communication (e.g., a hard disk and a camera can exchange data without CPU
intervention).
Supports Dual Transfer Methods:
Asynchronous: Allocates 20% of the bus for standard data transfer.
Isochronous: Reserves 80% for real-time, time-sensitive data.
Guaranteed Bandwidth: Isochronous transfer ensures continuous data flow, ideal for real-time
applications like aircraft sensor data.
Full Duplex Communication: Unlike USB 2.0, which is half-duplex, FireWire supports full duplex
data transfer.
Direct Memory Access (DMA) Support: Allows direct data transfer to memory, but also introduces a
security risk (DMA attack).
Supports Up to 63 Devices: Uses a daisy-chain topology for multiple peripherals.
FIREWIRE 20

FireWire: 3 prongs
1. Data: High-speed transfer with both
asynchronous and isochronous modes, also
supports plug and play.
2. Power: 6-pin and 9-pin connectors can draw
power from the connected device.
3. Peer-to-Peer Communication: Devices can
communicate without a host controller, unlike
USB.
21
FIREWIRE: TECHNICALITIES
Encoding Scheme:
Data/Strobe Encoding (also called Alpha mode)
Uses two NRZ signals (Data & Strobe) for high-reliability transmission.
Strobe Signal = XOR of data and clock.
At the receiver: Clock is recovered by XORing data & strobe, eliminating the need for a separate clock
line.
Enables synchronization, peer-to-peer communication, and isochronous data transfer.
Arbitration Mechanism:
Manages device access to the bus in 125 µs cycles.
The root node (nearest device) sends a cycle start packet.
All devices respond; the closest wins and gains control of the bus.
Other devices take turns in 125 µs slots, with isochronous transfers getting priority.
22
FIREWIRE: STANDARDS
IEEE 1394 (FireWire 400) IEEE 1394b (FireWire 800)
Speeds: 100/200/400 Mbit/s (S100, S200, Apple’s 9-conductor connector introduced.
S400). Speed: Almost 800 Mbit/s.
Cable Length: Up to 4.5 meters. Introduced a new beta mode encoding.
Can be daisy-chained up to 72 meters using FireWire S800T
repeaters. Speed: 800 Mbit/s.
Power Consumption: 7-8W, usually 25V, but FireWire S1600 & S3200
Apple’s connector used 9V. Speed:
Connector: 6 conductors. S1600: 1.57 Gbit/s
IEEE 1394a S3200: 3.14 Gbit/s
Improvement over the earlier version and
standardized as i.LINK.
Connector: 4 conductors, commonly used in
cameras and PCs.
23
USB
USB stands for Universal Serial Bus
Robust and widely used communication standard for connecting peripherals like keyboard and
mouse to a host system
Designed for ease of use with features like hot-plugging
Provides power and data transfer over the same cable, reducing the need for external power supplies.
Multiple versions of USB
USB 1.1 (12 Mbps)
USB 2.0 (480 Mbps)
USB 3.0+ (SuperSpeed) (5-40 Gbps in USB 4.0).
It is also backward compatible.
24
USB TRANSACTION TYPES
Control Transfers
Used for sending commands to the device, make inquiries, and configure the device.
Interrupt Transfers
Used for sending small amounts of bursty data that requires a guaranteed minimum latency.
Bulk Transfers
Used for large data transfers that use all available USB bandwidth with no guarantee on transfer
speed or latency.
Isochronous Transfers
Like synchronous, it guarantees a consistent data transfer rate.
Like asynchronous, it does not require a strict clock signal between sender and receiver.
Isochronous transfers are capable of this guaranteed delivery time due to their guaranteed
latency, guaranteed bus bandwidth, and lack of error correction. Without the error correction,
there is no halt in transmission while packets containing errors are resent.
25
USB PACKET TYPES
1. Token packets
Initiate transaction
Identify device involved in transaction
Always sourced by the host
2. Data packets
Delivers payload data
Sourced by host or device
3. Handshake packets
Acknowledge error-free data receipt
Sourced by receiver of data
4. Special packets
Facilitates speed differentials
Sourced by host-to-hub devices
Pulchowk Campus | 2025

THANK YOU

You might also like