250 likes | 471 Views
High Speed Digital Systems Lab. USB host for web camera connection. Presenters: Alexander Shapiro Sergey Alexandrov. Midterm presentation. Supervisor: Mike Sumszyk. Agenda. Project Objectives. System Architecture. USB Basics and general protocol. ISP1362 specific protocol.
E N D
High Speed Digital Systems Lab USB host for web camera connection Presenters: Alexander Shapiro Sergey Alexandrov Midterm presentation Supervisor: Mike Sumszyk
Agenda • Project Objectives. • System Architecture. • USB Basics and general protocol. • ISP1362 specific protocol. • Implementation. • Timeline.
Project Objectives • Implementation of SOPC interface for USB webcam. • Learn USB host protocol. • Learn webcam protocol. • Learn SOPC Development tools. • Understand NIOS II architecture. • Building NIOS II softcore system. • Stream real-time video to VGA.
Development Environment • Altera DE2 board • Provides USB support for host and device application. • VGA output (up to1600 x 1200 at 100-Hz refresh rate). • Cyclone II FPGA • Programmable chip to implement any design. • Programming tools: • Quartus II • Nios II IDE • SOPC Builder
System Architecture Input • USB Philips ISP1362 controller. • Transferrate: 12 Mb/s. • Optional: DE3 board with USB 2.0. • up to 480 Mb/s. Output • VGA DAC (10-bit triple DACs). • Up to 1600x1200 at 100-Hz.
USB Basics Host and Client • Host is master controller that initiates USB connection and traffic. Host is responsible to serve and control all the clients. • Client is device that connects to the host. Clients are divided to defined classes, like video/audio class, HID, etc. Each class has generic and specific properties.
USB Basics Terminology • Speed - usb bus speed, full speed (USB1.1), high speed (USB2) or low speed. • Port is physical interface between host and client. DE-2 has 2 USB-ports. • Descriptor is data structure that resides in client`s memory and describes different aspects of the device (speed, resolution, supported protocols etc.)
USB Basics Generic Descriptors • Device Descriptor -contains basic device description. (speed, brand, vendor) • Configuration Descriptor – specifies device`s features and abilities. Consists of Interface Descriptors that describe each separate feature. (device class, supported data transfers and formats, resolution and bit rate)
USB Basics Video Class Interface Descriptor: • Describes Video interface. • Endpoint Descriptors. • Defines ISO packet size and direction. • Video Format Descriptors. • Defines streaming video format. • Video Frame Descriptors. • Defines resolution and frame interval.
USB generic protocol When device is connected • Host initializes connection and determines kind of the device. • Host requests configuration descriptor. • Probe and commit sequence. • Host selects data interface. • Device is configured and ready to work.
USB generic protocol When device is connected • Host initializes connection and determines kind of the device. • Host switches USB-port to operational mode. • Host enumerates connected device. • Host requests Device Descriptor. This stage is needed to determine device speed and maximum packet size.
USB generic protocol When device is connected • Host requests configuration descriptor. • In this stage Host learns what kind of device is connected and what is abilities. • What services it provides, and at what rates. • Number of configurations (Interface descriptors) • Other basic information
USB generic protocol When device is connected • Probe and commit sequence. • Negotiation between Host and Video streaming interface. • Consists of Host`s requests with supported streaming parameters (bit rate, resolution) and Client`s confirmation/denial • When acceptable combination is obtained Host sends commit request on these parameters.
USB generic protocol When device is connected • Host selects data interface. • Host selects data interface that corresponds to committed parameters. • After this stage device is configured and ready to work.
ISP1362 general description Support Bulk, Control, Interrupt and ISO transfers. Each transfer type has separate buffer. ATL, INT and ISTL0/1 and buffers. Supports two USB ports. All interaction with Host is implemented with read/write control registers that are mapped to NIOS memory for direct access.
ISP1362 general description • Support Bulk, Control, Interrupt and ISO transfers. • Control - Used to get device description and configuration. • Bulk - Used for transferring big data chunks. • Interrupt - Used for polling small data requests. • Isochronous - Used for Audio/Video streams.
ISP1362 general description Philips Transfer Descriptor (PTD) • Provides a communication channel between Host controller and NIOS. • Structure: • Header: • Packet size. • Type of request. • Direction of transfer. • Payload: • Data/Command. (only if required)
ISP1362 general description Nios to Host Nios to Host Host to Nios PTD 1 PTD 2 PTD 3 Typical data transfer in Bulk mode.
ISP1362 specific protocol Host and device initialization: Buffer’s sizes must be set for all kinds of traffic (ATL, ISTL0/1 and INT buffers). Ports must be powered up and enabled. Operational state must be entered in order to allow USB traffic. Prior to this host is in suspended state.
ISP1362 specific protocol Host Register setup Control Transfer mode Host and device initialization: • Init ATL, ISTL0/1 and INT buffers. • Init USB port1 and port2. • Enter operational mode. • Detect device connection. • Enable connected port1. • Enumerate • Get device description. • Configure device.
References Philips Embedded Programming guide Philips ISP 1362 Data Sheet USB 2.0 Specification USB Video Class Specification USB Complete by Jan Axelson Google