introduction electrical considerations data transfer synchronization bus arbitration vme bus local...

51
3. Buses Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/2014 1 Input/Output Systems and Peripheral Devices (03-4)

Upload: domenic-hodges

Post on 25-Dec-2015

231 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

1

3. Buses

IntroductionElectrical ConsiderationsData Transfer SynchronizationBus ArbitrationVME BusLocal BusesPCI BusPCI Bus VariantsSerial Buses

11/06/2014 Input/Output Systems and Peripheral Devices (03-4)

Page 2: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

2

Serial Buses

Serial BusesI2C BusUSB

11/06/2014 Input/Output Systems and Peripheral Devices (03-4)

Page 3: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

3Input/Output Systems and Peripheral Devices (03-4)

Serial Buses

Viable alternatives to parallel buses Advantages:

Smaller connectors Reduced susceptibility to electrical interferences Longer interconnection distanceHigher reliabilityLower cost of the interface

11/06/2014

Page 4: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

4Input/Output Systems and Peripheral Devices (03-4)

Serial Buses

Serial BusesI2C BusUSB

11/06/2014

Page 5: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

5Input/Output Systems and Peripheral Devices (03-4)

I2C Bus

I2C BusOverviewStart and Stop ConditionsData TransfersBus Variants

11/06/2014

Page 6: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

Input/Output Systems and Peripheral Devices (03-4) 6

Overview (1)

I2C (Inter-Integrated Circuits) – PhilipsBidirectional bus with two wires:

SDA (Serial Data)SCL (Serial Clock)

11/06/2014

Page 7: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

7Input/Output Systems and Peripheral Devices (03-4)

Overview (2)

A device connected to the I2C bus can operate as:

Receiver Transmitter and receiver

Each device has a unique addressTransmitters and receivers can operate either in master or slave modeMultiple master devices can be connected to the bus

Arbitration procedure11/06/2014

Page 8: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

8Input/Output Systems and Peripheral Devices (03-4)

I2C Bus

I2C BusOverviewStart and Stop ConditionsData TransfersBus Variants

11/06/2014

Page 9: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

Input/Output Systems and Peripheral Devices (03-4) 9

Start and Stop Conditions (1)

Generated by the master deviceStart 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

Page 10: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

Input/Output Systems and Peripheral Devices (03-4) 10

Start and Stop Conditions (2)

Data on the SDA line must be stable while SCL is logical 1Data can be changed only when SCL is logical 0

11/06/2014

Page 11: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

11Input/Output Systems and Peripheral Devices (03-4)

I2C Bus

I2C BusOverviewStart and Stop ConditionsData TransfersBus Variants

11/06/2014

Page 12: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

12Input/Output Systems and Peripheral Devices (03-4)

Data Transfers (1)

Categories of information sent on the I2C bus:

Start bitSlave device address (7 or 10 bits)Read/write bitData bits (segments of 8 bits each)Acknowledge bit (after each data segment)Stop bit

11/06/2014

Page 13: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

Input/Output Systems and Peripheral Devices (03-4) 13

Data Transfers (2)

Example transferThe number of bytes in a transfer is not restrictedThe receiver can force the transmitter into a wait state

11/06/2014

Page 14: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

14Input/Output Systems and Peripheral Devices (03-4)

Data Transfers (3)

Three formats for data transfers:Write data from a master transmitter to a slave receiver Read data by a master deviceMultiple 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 masterLSB = 1: read data from slave

11/06/2014

Page 15: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

15Input/Output Systems and Peripheral Devices (03-4)

I2C Bus

I2C BusOverviewStart and Stop ConditionsData TransfersBus Variants

11/06/2014

Page 16: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

16Input/Output Systems and Peripheral Devices (03-4)

Bus Variants (1)

Original I2C busMaximum transfer rate of 100 Kbits/s7-bit addresses

Version 2.0 Fast transfer mode, max. 400 Kbits/s10-bit addressesPossibility to connect devices with 7-bit or 10-bit addresses

11/06/2014

Page 17: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

17Input/Output Systems and Peripheral Devices (03-4)

Bus Variants (2)

Version 2.1Shifting of voltage levels (Level-shifting) in order to connect devices with different supply voltages Extended specifications for devices with voltages below 2.7 VHigh-speed transfer mode → maximum 3.4 Mbits/s

11/06/2014

Page 18: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

18Input/Output Systems and Peripheral Devices (03-4)

Serial Buses

Serial BusesI2CUSB

11/06/2014

Page 19: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

19Input/Output Systems and Peripheral Devices (03-4)

USB

USBIntroductionFeaturesBus Topology USB VersionsCables and ConnectorsElectrical InterfaceTransfer Types

11/06/2014

Page 20: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

20Input/Output Systems and Peripheral Devices (03-4)

IntroductionUSB – 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 peripheralsProvide high data transfer ratesEase of use (“Plug and Play”)Eliminate the restrictions due to insufficient hardware resources

11/06/2014

Page 21: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

21Input/Output Systems and Peripheral Devices (03-4)

USB

USBIntroductionFeaturesBus Topology USB VersionsCables and ConnectorsElectrical InterfaceTransfer Types

11/06/2014

Page 22: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

22Input/Output Systems and Peripheral Devices (03-4)

FeaturesDetects when a new peripheral is added Determines the resources it needsAdding and removing a peripheral can be done without shutting down the computerA tree-like interconnection is possible, with up to 127 peripheralsThe peripherals are powered with +5 V through the cableMaster/slave (host/device) architecture: data transfers initiated by the master

11/06/2014

Page 23: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

23Input/Output Systems and Peripheral Devices (03-4)

USB

USBIntroductionFeaturesBus Topology USB VersionsCables and ConnectorsElectrical InterfaceTransfer Types

11/06/2014

Page 24: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

24

Bus Topology (1)

Hubs Functions (devices)

11/06/2014 Input/Output Systems and Peripheral Devices (03-4)

Page 25: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

25Input/Output Systems and Peripheral Devices (03-4)

Bus Topology (2)

USB HubsRecognize dynamic attachment of a peripheralProvide a power of at least 0.5 W for each peripheral during initializationCan provide a power of up to 2.5 W for peripheral operation Each hub consists of:

Repeater: switchController: interface registers for communication with the host

11/06/2014

Page 26: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

Input/Output Systems and Peripheral Devices (03-4) 26

Bus Topology (3)

Upstream port (for host)Downstream ports (for functions)Cascaded connection up to 5 levels

11/06/2014

Page 27: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

27Input/Output Systems and Peripheral Devices (03-4)

Bus Topology (4)

11/06/2014

Page 28: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

28Input/Output Systems and Peripheral Devices (03-4)

Bus Topology (5)

USB FunctionsUSB peripherals that are able to transmit or receive data or control informationA peripheral may contain multiple functionsMust 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

Page 29: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

29Input/Output Systems and Peripheral Devices (03-4)

USB

USBIntroductionFeaturesBus Topology USB VersionsCables and ConnectorsElectrical InterfaceTransfer Types

11/06/2014

Page 30: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

30Input/Output Systems and Peripheral Devices (03-4)

USB Versions (1)

Version 1.0 (1995): max. 12 Mbits/sVersion 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 interfacesAllows to use new types of peripherals: video cameras, scanners, printers

11/06/2014

Page 31: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

31Input/Output Systems and Peripheral Devices (03-4)

USB Versions (2)

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 roleTwo devices can communicate with each other without a computer

Tablet printer Printer camera

11/06/2014

Page 32: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

32Input/Output Systems and Peripheral Devices (03-4)

USB Versions (3)

Version 3.0 Specifications completed in 2008 by the USB 3.0 Promoter Group SuperSpeed mode: 5 Gbits/sTwo simplex differential channels in addition to the existing differential channel a total of 8 wiresTechnology is similar to PCI Express 2.0 8b/10b encoding (500 MB/s)

11/06/2014

Page 33: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

33Input/Output Systems and Peripheral Devices (03-4)

USB

USBIntroductionFeaturesBus Topology USB VersionsCables and ConnectorsElectrical InterfaceTransfer Types

11/06/2014

Page 34: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

Input/Output Systems and Peripheral Devices (03-4) 34

Cables and Connectors (1)

Differential signals on the D+ and D- wiresSupply voltage for peripherals on the VBUS wireTerminations at each end of the cable

Provide correct voltage levels for peripheralsAllow detection of attach and detach of devicesDifferentiate between full- and low-speed devices

11/06/2014

Page 35: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

35Input/Output Systems and Peripheral Devices (03-4)

Cables and Connectors (2)

The original USB specification defines Type-A and Type-B plugs and socketsHosts and hubs: Type-A socket (rectangle)Peripherals: Type-B socket (square) In general, cables have only plugs

11/06/2014

Page 36: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

Input/Output Systems and Peripheral Devices (03-4) 36

Cables and Connectors (3)

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

Page 37: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

Input/Output Systems and Peripheral Devices (03-4) 37

Cables and Connectors (4)

Mini-USB and micro-USB connectors for tablets, mobile phones, camerasMini-USB: 7 x 3 mm; not used in new devicesMicro-USB: 7 x 1.5 mm

11/06/2014

Page 38: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

38Input/Output Systems and Peripheral Devices (03-4)

Cables and Connectors (5)

USB OTGMicro-AB socketsAllow to connect either a micro-A or a micro-B 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

Page 39: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

39Input/Output Systems and Peripheral Devices (03-4)

USB

USBIntroductionFeaturesBus Topology USB VersionsCables and ConnectorsElectrical InterfaceTransfer Types

11/06/2014

Page 40: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

40Input/Output Systems and Peripheral Devices (03-4)

Electrical Interface

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

Page 41: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

41Input/Output Systems and Peripheral Devices (03-4)

USB

USBIntroductionFeaturesBus Topology USB VersionsCables and ConnectorsElectrical InterfaceTransfer Types

11/06/2014

Page 42: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

42Input/Output Systems and Peripheral Devices (03-4)

Transfer Types (1)

Control TransfersUsed by the host drivers to configure the peripherals

Bulk TransfersConsist of large amounts of dataUsed for printers, scanners etc. Reliability ensured by: error detection code; retries of erroneous transfers Transfer rate can vary

11/06/2014

Page 43: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

43Input/Output Systems and Peripheral Devices (03-4)

Transfer Types (2)

Interrupt TransfersUsed 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

Page 44: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

44Input/Output Systems and Peripheral Devices (03-4)

Transfer Types (3)

Isochronous TransfersIsos – equal, uniform; chronos – time Isochronous – with equal duration; that occurs at equal intervalsUsed 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

Page 45: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

45Input/Output Systems and Peripheral Devices (03-4)

Transfer Types (4)

The timely delivery of data is ensured at the expense of potential losses in the data streamDedicated 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

Page 46: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

46Input/Output Systems and Peripheral Devices (03-4)

Summary (1)

Serial buses have several advantages compared to parallel busesThe I2C bus has been developed for the communication between microcontrollers and various peripherals

To achieve bus control, a start condition has to be generatedTo release the bus, a stop condition has to be generatedEach byte sent is followed by an acknowledge bit Ack

11/06/2014

Page 47: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

47Input/Output Systems and Peripheral Devices (03-4)

Summary (2)

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 determinedStar 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

Page 48: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

48Input/Output Systems and Peripheral Devices (03-4)

Summary (3)

The electrical interface uses the NRZI encodingThe USB allows several types of data transfers:

Control transfersBulk transfersInterrupt transfersIsochronous transfers

Isochronous transfers enable to allocate a dedicated portion of bandwidth for data generated in real time

11/06/2014

Page 49: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

49Input/Output Systems and Peripheral Devices (03-4)

Concepts, Knowledge (1)

Advantages of serial busesOverview of I2C busStart and stop conditionsData transfers on the I2C busI2C bus variantsFeatures of USBUSB hubsUSB functions

11/06/2014

Page 50: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

50Input/Output Systems and Peripheral Devices (03-4)

Concepts, Knowledge (2)

USB OTG versionUSB 3.0 versionThe role of USB terminatorsThe electrical interface of USBTransfer types on the USBBulk transfersInterrupt transfersIsochronous transfers

11/06/2014

Page 51: Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output

51Input/Output Systems and Peripheral Devices (03-4)

Questions

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