ECE 371 – UNIT 20 Universal Serial Bus (USB). References 1. Universal Serial Bus Specification, Revision 2.0. This specification is available on the World.

Slides:



Advertisements
Similar presentations
Computer Organization, Bus Structure
Advertisements

INPUT-OUTPUT ORGANIZATION
I/O Interfaces.
William Stallings Data and Computer Communications 7th Edition
Protocol Layer Bottom-up view of the USB protocol Bottom-up view of the USB protocol –Byte/Bit Ordering –SYNC Field –Packet Field Formats PID Field PID.
Universal Serial Bus Grant Heileman. The History of USB In 1994 a collaborative effort to design a standard for peripheral devices was made between Compaq,
Serial I/O - Programmable Communication Interface
1 Fall 2005 Local Serial Asynchronous Communication Qutaibah Malluhi Computer Science and Engineering Qatar University.
Local Asynchronous Communication and RS-232. Goals Explain how electric current can be used to transmit bits over short distances Present a popular mechanism.
USB: Data Flow Sukesh Shenoy. USB implementation areas.
Data Communications and Computer Networks: A Business User’s Approach
1 Chapter Four Making Connections. 2 Introduction Connecting peripheral devices to a computer has, in the past, been a fairly challenging task Newer interfaces.
1 USB 2.0 Specification  General Description  From where we could begin the work  What would be valid to do?  Main doubts  What is OTG (On the Go)
USB – An Overview Group 3 Kaushik Nandha Bikram What is the Universal Serial bus (USB)? Is a cable bus that supports data exchange between a host computer.
Chapter 10 Supporting I/O Devices. You Will Learn…  How to install peripheral I/O devices  How to use ports and expansion slots for add- on devices.
1 COMP541 Interrupts, DMA, Serial I/O Montek Singh April 24, 2007.
Review on Networking Technologies Linda Wu (CMPT )
Anush Rengarajan Feng Zheng Thomas Madaelil
USB 2.0 INTRODUCTION NTUT CSIE 學 生:許家豪 指導教授:柯開維教授.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 15 PC Standard Bus Interfaces WK.
Input/Output and Communication
Interface circuits I/O interface consists of the circuitry required to connect an I/O device to a computer bus. Side of the interface which connects to.
EE 446 Embedded Architecture. Universal Serial Bus A representative peripheral interface Universal Serial Bus (USB) provides a serial bus standard for.
Local Asynchronous Communications. Bit-wise data transmission Data transmission requires: Encoding bits as energy Transmitting energy through medium Decoding.
USB: UNIVERSAL SERIAL BUS Joe Kaewbaidhoon Alex Motalleb Vishal Joshi Prepared for EECS 373 University of Michigan, Ann Arbor 1.
Computer communication. Introduction Mechanisms applied in communicating between a computer and another computer or with other devices. Mainly serial.
18 - Winter 2003 EE EE 766 Computer Interfacing and Protocols 1 USB (Universal Serial Bus) Need for “Plug and Play” capability for PC peripherals outside.
3/17 Parallel and Serial Ports. Roll Call Lecture: –ports –serial ports –parallel ports –USB ports Group Project Information - Handout.
INPUT-OUTPUT ORGANIZATION
USB Josh Rickmar John Marcoux. Topics Purpose and Goals History Bus Design Power Differential Signaling Connectors Changes in USB 3.0.
SERIAL BUS COMMUNICATION PROTOCOLS
Technology Training that Works Hands of Data Communications, Networking & TCP/IP Troubleshooting.
What is USB? Prototyping Unit.
Spring 2014 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.
Transmission Modes Serial Transmission  One bit is transmitted on a circuit at a time  Usually there is one transmit circuit and one receive circuit.
Computers in Surveying SVY2301 / E4006 Automated Surveying.
Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses 11/06/20141Input/Output.
Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in.
Introduction to USB Development. USB Development Introduction Technical Overview USB in Embedded Systems Recent Developments Extensions to USB USB as.
Introduction to USB © 2010 Renesas Electronics America Inc. All rights reserved.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 22 All About SCSI.
Using the PSoC USB March 17, 2012 Lloyd Moore, President/Owner.
USB Link Layer Protocol
9/28: Buses & Communication Buses: highways of the motherboard –system buses –local buses: PCI, ISA, EISA –expansion slots plug & play laptops: PCMCIA.
Serial Port I/O Serial port sends and receives data one bit at a time. Serial communication devices are divided into: Data Communications Equipment (DCE),
Input/OUTPUT [I/O Module structure].
Microprocessor-based Systems
Computer Architecture Lecture10: Input/output devices Piotr Bilski.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
BR 6/001 Universal Serial Bus Universal Serial Bus is a new synchronous serial protocol for low to medium speed data transmission Full speed signaling.
Input/Output 2 What is I/O? How we get the CPU to communicate with devices From the computer’s point of view, it’s just 1’s and 0’s Gets interpreted.
February 10 th 2010 Dehmani Feth-Allah M2 ISTRe Oral Presentation Universal Serial Bus.
Data Communications (E&T2760): USB and IEEE USB and IEEE 1394.
Computer communication. Introduction Mechanisms applied in communicating between a computer and another computer or with other devices. Mainly serial.
PPI-8255.
بسم الله الرحمن الرحيم MEMORY AND I/O.
USB Universal Serial Bus. University of Tehran 2.
Chapter 6 Input/Output Organization
USB PHYISICAL LAYER PROTOCOL ENGINE LAYER APPLICATION LAYER
Operating Systems (CS 340 D)
USB Universal Serial Bus
C_ITCO011/C_ITCO111 LECTURER: E.DONDO
Local Asynchronous Communication (RS-232)
Universal Serial Bus Specification 1.0
USB- Universal Serial Bus
USB : Universal Serial Bus
Parallel communication interface 8255
Universal Serial Bus (USB)
Presentation transcript:

ECE 371 – UNIT 20 Universal Serial Bus (USB)

References 1. Universal Serial Bus Specification, Revision 2.0. This specification is available on the World Wide Web site Universal Serial Bus Device Class Definition for Printing Devices, Version 1.1. This specification is available on the World Wide Web site 3. Jan Axelson, USB Complete: Everything You Need to Develop Custom USB Peripherals, Second Edition, ISBN , Lakeview Research, Madison, WI 53704, Microchip PIC16C745/765. This single chip computer supports USB. Data sheets and application notes are available on the World Wide Web site

USB Overview Universal Serial Bus (USB) is a fast and flexible interface. Connects up to 127 devices to a personal computer. All recent PCs are marketed with at least one and often several USB ports.

USB Overview The USB interface is versatile enough to support all standard peripherals such as keyboards, printers, mice, network interfaces, RS 232 serial, cameras, and disk drives. The older standard interfaces such as the parallel port, the COM ports, the PS2 ports, and infrared ports are slowly being eliminated on newer PCs and being replaced with USB as the standard interfaces to peripherals.

USB Components Host computer provides two components: –A host controller –A root hub

USB Topology USB uses a “tiered star” configuration for connecting hubs and devices to the Root Hub Hub is the center of each star Hubs provide the data path between the device and the root hub Root Hub is limited to 127 devices Tree cannot be more than 6 levels deep.

Topology

Host Centric Architecture USB is a host centric architecture Host is always the master Devices are allowed to transmit only when specifically instructed to by the host Devices are polled by the host.

Example Host with 2 Peripherals

Example PC with 6 Peripherals

Example – Host with 15 Peripherals

Connectors Type A Type B

USB Cable Wiring There are 4 wires in the cable 2 Power (+5 Volts, ground) 2 Signal wires (–D, +D) Low Power Devices and Hubs can be powered from 2 power wires

USB 1.0 Full Speed 12 Megabits/sec Low Speed 1.5 Megabits/Sec

USB 2.0 High Speed 480 Megabits/Sec

Bus States “Differential 1” : D+ is more positive that D- “Differential 0” : D- is more positive than D+

Relation Between Bus States and Data States Bus State Data State Low Speed Full Speed High Speed Differential 0 J K K Differential 1 K J J

USB 1.0 Bus States (Low Speed and Full Speed) Vout high min = 2.8 v Vout low max =.3v Vin high min = 2.0 v Vin low max =.8v

USB 2.0 Bus States (High Speed) Vout high min =.360 v Vout low max =.010v

Data Encoding – NRZI NRZI defines logic “0” as a voltage change and a logic “1” as a voltage that remains the same. The least significant bits are transmitted first. The receiver is automatically synchronized with the transmitter by transitions in the signal.

NRZI with Bit Stuffing Insure synchronization. A logic “0” is automatically inserted after 6 “1”s on transmission A logic “0” is deleted automatically after 6 “1”s on receive.

Example of NRZI 0: Voltage change 1: No voltage change

Frames The host schedules transactions within 1- millisecond frames for low speed and full speed. For high speed, 125 microsecond frames are used. Each frame begins with a Start-of-Frame packet followed by transactions that transfer data to or from device endpoints. The host can schedule transactions anywhere inside a frame.

Start of frame Device 1,endpoint 2 Device 2, Endpoint 0 Device 2, Endpoint 2 Unused Transactions Start of Frame Packet Token Packet: (First Packet in Each Frame) Example of Frame (1 msec)

Example of Frame SOFTransaction... SOFTransaction 1 ms or 125 us Frame Number is incremented from One Frame to the Next

Define: “Transfer” The process of making and carrying out a communication request. A complete transfer may take place over multiple frames Each transfer consists of 1 or more Transactions.

Define: “Transaction” Delivery of service to an end-point ( the host’s sending a chunk of data to a device or the host’s requesting and receiving a chunk of information from the device) No other other communication on the bus can break into a transaction Each transaction consists of phases (packets)

Define: “Packet” A block of information with a fixed format All packets start with a packet id, which identify the packet type Other information that may be included in packet: - Endpoint Address - Data - Status Information - Frame Number - Error Checking Bits

Example Transfers

Four Types of Transfers Control Transfers Bulk Transfers Interrupt Transfers Isosynchronous Transfers

Control Transfers Used by the host to: Read information about a device Set a device’s address Select configurations and other settings Send custom requests that send and receive data for any purpose.

Bulk Transfers Intended for situations where the transfer rate is not critical, such as: Sending a file to a printer Receiving data from a scanner

Interrupt Transfers Used for devices that must have attention periodically, without large delay such as: Mice Keyboards Joysticks

Isosynchronous Transfers Used for applications that must have a guaranteed delivery time, such as - Transferring audio files that must be played in real time. Guarantees a fixed amount of data at a fixed rate. Trades off guaranteed data accuracy for guaranteed timeliness. No data checking is performed, and the loss of data is not catastrophic.

3 Types of Transactions Status – For sending control/transfer requests to a device In - For receiving data from a device Out – For sending data to a device

4 Types of Packets (each type has 4 sub-types, for a total of 16 kinds of packets) Token – Identifies the transaction type Data - Carries data or status information Handshake – Carries status information Special

Start of Frame Packet (One of the 4 Token Packets) Packet ID One’s complement of Packet ID

Format for Other 3 Token Packets (Out, In, Setup_ Select 1 of 127 devices Select 1 of 16 device endpoints

Device Addresses ADDR – 7 bits Each device is assigned a 7-bit address Assigned addresses are 1, 2, …, 127

End Points ENDP – 4 bits End points are device registers Each device has 1 to 16 End Points Assigned end points are 0, 1, …, 15 End point 0 is device control Up to 16 IN End Points Up to 16 OUT End Points

Data Packet

Handshake Packet

CRC Error Checking CRC5 – 5-bit Cyclic Redundancy Check CRC16 – 16-bit Cyclic Redundancy Check

Token Packets - 4 Kinds

Date Packets - 4 Kinds

Handshake Packets - 4 Kinds

Special Packets - 4 Kinds

Handshake Packets PING and NYET packets require High Speed (USB 2.0). ACK – Packet was received correctly. NAK – The NAK is sent for a number of reasons. Packet was received correctly but the host should resend data because of a temporary condition such as a buffer overflow caused a loss of data. Sender can not send data. Sender has no data to send. If packet was received in error, then no response is sent.

Packet Coding Prior to transmitting a packet, line is in the Idle State (J). Each packet begins with a SYNC character and is terminated with an End- of-Packet signal. For low and full speeds, the SYNC is eight bits and is KJKJKJKK. For high speed, the SYNC is 32 bits: 15 KJ repetitions following by KK.

Packet SYNCPacketEOP

Summary of Transfer Format

Enumeration (Overview) Enumeration is the process that the host uses to either identify a hub or device whenever it is connected to or disconnected from a hub. USB Enumeration is started whenever a hub or device is plugged into USB hub port or system powers up. Enumeration includes (among other things): –Hub determines speed of device (High, Full, or Low) –Hub determines class of device (e.g, printer, keyboard, camera, etc.) –Hub assigns address to device –(Full list of Enumeration step are shown on following slides)

Enumeration (in detail) Enumeration is the process that the root uses to either identify a hub or device whenever it is connected to or disconnected from a hub. 1. USB Enumeration is started whenever a hub or device is plugged into USB hub port or system powers up. 2. Hub detects the device. D+ = High, D- = Low – full speed device or high speed D+ = Low, D- = High – low speed device 3. Host sends the hub a Get_Port_Status and other hub class-class requests for information. 4. Hub returns speed in response to Get_Port_Status request from host.

Enumeration 5. Host sends a Set_Port_Feature to instruct hub to reset the port. Reset = D+ = D- = Low for at least 10 milliseconds 6. Host determines if full-speed device supports high speed. Device sends Chirp K. High speed hub responds with Chirp KJKJKJ Device detects Chirp KJKJKJ and performs all further communications at High Speed.

Enumeration 7. Host establishes signal path between host and device Host sends Get_Port_Status until the hub exits reset state Device now in Default state. Responds to Address = 0, Endpoint = 0 8. Host sends Get_Descriptor to get device’s maximum packet size. 9. Host assigns an address with Set_Address request.

Enumeration 10. Host sends one or more Get_Descriptor request to learn the identify of the device and the device’s abilities. 11. Host assigns and load a device driver. 12. Host send Set_Configuration to selects a configuration supported by driver