Transcript 3. Buses

Introduction
Electrical Considerations
Data Transfer Synchronization
Bus Arbitration
VME Bus
Local Buses
PCI Bus
PCI Bus Variants
Serial Buses
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
1
Serial Buses
I2C Bus
USB
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
2
Viable alternatives to parallel buses
Advantages:
Smaller connectors
Reduced susceptibility to electrical
interferences
Longer interconnection distance
Higher reliability
Lower cost of the interface
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
3
Serial Buses
I2C Bus
USB
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
4
2
I C Bus
I2C Bus
Overview
Start and Stop Conditions
Data Transfers
Bus Variants
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
5
I2C (Inter-Integrated Circuits) – Philips
Bidirectional bus with two wires:
SDA (Serial Data)
SCL (Serial Clock)
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
6
A device connected to the I2C bus can
operate as:
Receiver
Transmitter and receiver
Each device has a unique address
Transmitters and receivers can operate
either in master or slave mode
Multiple master devices can be connected
to the bus
Arbitration procedure
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
7
2
I C Bus
I2C Bus
Overview
Start and Stop Conditions
Data Transfers
Bus Variants
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
8
Generated by the master device
Start condition:
1  0 transition on the SDA line, SCL = logical 1
Stop condition:
0  1 transition on the SDA line, SCL = logical 1
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
9
Data on the SDA line must be stable while SCL
is logical 1
Data can be changed only when SCL is logical 0
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
10
I2C Bus
Overview
Start and Stop Conditions
Data Transfers
Bus Variants
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
11
Categories of information sent on the I2C
bus:
Start bit
Slave device address (7 or 10 bits)
Read/write bit
Data bits (segments of 8 bits each)
Acknowledge bit (after each data segment)
Stop bit
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
12
Example transfer
The number of bytes in a transfer is not
restricted
The receiver can force the transmitter into a
wait state
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
13
Three formats for data transfers:
Write data from a master transmitter to a
slave receiver
Read data by a master device
Multiple read and write transfers
The address and direction of data are
encoded in the first byte after the start bit
LSB = 0: write data from master
LSB = 1: read data from slave
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
14
I2C Bus
Overview
Start and Stop Conditions
Data Transfers
Bus Variants
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
15
Original I2C bus
Maximum transfer rate of 100 Kbits/s
7-bit addresses
Version 2.0
Fast transfer mode, max. 400 Kbits/s
10-bit addresses
Possibility to connect devices with 7-bit or
10-bit addresses
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
16
Version 2.1
Shifting of voltage levels (Level-shifting) in
order to connect devices with different
supply voltages
Extended specifications for devices with
voltages below 2.7 V
High-speed transfer mode → maximum 3.4
Mbits/s
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
17
Serial Buses
I2C
USB
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
18
USB
Introduction
Features
Bus Topology
USB Versions
Cables and Connectors
Electrical Interface
Transfer Types
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
19
USB – Universal Serial Bus
Developed in 1995 by a group of companies:
HP, Compaq, Intel, Lucent, Microsoft, NEC
USB Implementers Forum (www.usb.org)
Motivation:
Simplify the connections with peripherals
Provide high data transfer rates
Ease of use (“Plug and Play”)
Eliminate the restrictions due to insufficient
hardware resources
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
20
USB
Introduction
Features
Bus Topology
USB Versions
Cables and Connectors
Electrical Interface
Transfer Types
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
21
Detects when a new peripheral is added
Determines the resources it needs
Adding and removing a peripheral can be
done without shutting down the computer
A tree-like interconnection is possible, with
up to 127 peripherals
The peripherals are powered with +5 V
through the cable
Master/slave (host/device) architecture:
data transfers initiated by the master
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
22
USB
Introduction
Features
Bus Topology
USB Versions
Cables and Connectors
Electrical Interface
Transfer Types
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
23
Hubs
Functions (devices)
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
24
USB Hubs
Recognize dynamic attachment of a
peripheral
Provide a power of at least 0.5 W for each
peripheral during initialization
Can provide a power of up to 2.5 W for
peripheral operation
Each hub consists of:
Repeater: switch
Controller: interface registers for communication
with the host
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
25
Upstream port (for host)
Downstream ports (for functions)
Cascaded connection up to 5 levels
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
26
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
27
USB Functions
USB peripherals that are able to transmit or
receive data or control information
A peripheral may contain multiple functions
Must respond to transaction requests sent
by the host
Contain configuration information that
describe their capabilities and resources
needed
Configuring a function: allocating bandwidth
and selecting configuration options
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
28
USB
Introduction
Features
Bus Topology
USB Versions
Cables and Connectors
Electrical Interface
Transfer Types
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
29
Version 1.0 (1995): max. 12 Mbits/s
Version 1.1 (1998): max. 12 Mbits/s
Low-speed channel (1.5 Mbits/s)
Version 2.0 (2000)
The maximum transfer rate increased 40
times, to 480 Mbits/s (High-Speed)
Uses the same cables, connectors, and
software interfaces
Allows to use new types of peripherals:
video cameras, scanners, printers
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
30
USB On-The-Go (USB OTG)
Supplement to USB 2.0 specification (2006)
A device may have either the master or slave
role (host, peripheral)
Protocol to exchange the host/peripheral role
Two devices can communicate with each
other without a computer
Tablet  printer
Printer  camera
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
31
Version 3.0
Specifications completed in 2008 by the USB
3.0 Promoter Group
SuperSpeed mode: 5 Gbits/s
Two simplex differential channels in addition
to the existing differential channel  a total
of 8 wires
Technology is similar to PCI Express 2.0 
8b/10b encoding (500 MB/s)
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
32
USB
Introduction
Features
Bus Topology
USB Versions
Cables and Connectors
Electrical Interface
Transfer Types
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
33
Differential signals on the D+ and D- wires
Supply voltage for peripherals on the VBUS wire
Terminations at each end of the cable
Provide correct voltage levels for peripherals
Allow detection of attach and detach of devices
Differentiate between full- and low-speed devices
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
34
The original USB
specification defines
Type-A and Type-B plugs
and sockets
Hosts and hubs: Type-A
socket (rectangle)
Peripherals: Type-B
socket (square)
In general, cables have
only plugs
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
35
The data connectors in the Type-A plug are
recessed compared to the power connectors
Some devices operate in a different mode when
the connector is only partially inserted
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
36
Mini-USB and micro-USB connectors for tablets,
mobile phones, cameras
Mini-USB: 7 x 3 mm; not used in new devices
Micro-USB: 7 x 1.5 mm
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
37
USB OTG
Micro-AB sockets
Allow to connect either a micro-A or a microB plug
An ID pin: used to detect the type of the plug
inserted
Grounded in micro-A, floating in micro-B
If an A plug is connected: host role  power
supplier
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
38
USB
Introduction
Features
Bus Topology
USB Versions
Cables and Connectors
Electrical Interface
Transfer Types
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
39
Data are encoded  generation of a
receive clock signal is simplified
The encoding used is NRZI (Non Return to
Zero Inverted)
Bits of 1 and 0 are represented by opposite
and alternating voltages, without return to
zero voltage between encoded bits
Bit stuffing to ensure enough transitions of
the transmitted signals
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
40
USB
Introduction
Features
Bus Topology
USB Versions
Cables and Connectors
Electrical Interface
Transfer Types
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
41
Control Transfers
Used by the host drivers to configure the
peripherals
Bulk Transfers
Consist of large amounts of data
Used for printers, scanners etc.
Reliability ensured by: error detection code;
retries of erroneous transfers
Transfer rate can vary
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
42
Interrupt Transfers
Used for small amounts of data
A data transfer may be requested by a
peripheral at any time
The transfer rate cannot be lower than that
specified by the peripheral
Data consist of event notification, characters,
or coordinates
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
43
Isochronous Transfers
Isos – equal, uniform; chronos – time
Isochronous – with equal duration; that
occurs at equal intervals
Used for data generated in real time, that
must be delivered at the rate at which data
are received
The maximum delivery delay must also be
ensured
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
44
The timely delivery of data is ensured at the
expense of potential losses in the data stream
Dedicated portion of bandwidth
Isochronous transfers:
Timely data delivery
Lack of retries for erroneous data
Asynchronous transfers:
Correct data delivery
Retries for erroneous data
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
45
Serial buses have several advantages
compared to parallel buses
The I2C bus has been developed for the
communication between microcontrollers and
various peripherals
To achieve bus control, a start condition has to be
generated
To release the bus, a stop condition has to be
generated
Each byte sent is followed by an acknowledge bit
Ack
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
46
Motivations for developing the USB:
simplifying the connections with peripherals;
higher data transfer rates; ease of use
When a peripheral is attached, its required
resources are determined
Star topology, with hubs and functions
The USB OTG version enables a USB device to
initiate transfers with another device
The USB 3.0 version uses a technology similar
to that of the PCI Express 2.0 bus
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
47
The electrical interface uses the NRZI encoding
The USB allows several types of data transfers:
Control transfers
Bulk transfers
Interrupt transfers
Isochronous transfers
Isochronous transfers enable to allocate a
dedicated portion of bandwidth for data
generated in real time
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
48
Advantages of serial buses
Overview of I2C bus
Start and stop conditions
Data transfers on the I2C bus
I2C bus variants
Features of USB
USB hubs
USB functions
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
49
USB OTG version
USB 3.0 version
The role of USB terminators
The electrical interface of USB
Transfer types on the USB
Bulk transfers
Interrupt transfers
Isochronous transfers
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
50
1. What are the advantages of serial buses?
2. What are the main features of the USB
bus?
3. How can a USB host determine the
capabilities and resources needed by a
USB function?
4. What is the difference between
isochronous and asynchronous transfers?
11/06/2014
Input/Output Systems and Peripheral Devices (03-4)
51