usb host for web camera connection midterm presentation presenters: alexander shapiro sergey...
TRANSCRIPT
USB host for web camera
connection
Midterm presentation
Presenters:
Alexander Shapiro
Sergey Alexandrov
Supervisor:
Mike Sumszyk
High Speed Digital Systems Lab
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
Cyclone II FPGA
Philips ISP1362USB Controller
VGA D/A converter
USB 1.0 Port
VGA Port
On Chip Memory
NIOS IISoftCore
Avalon Switch
On- ChipMemory
InputUSB Philips ISP1362 controller.Transfer rate: 12 Mb/s.Optional: DE3 board with USB 2.0.
up to 480 Mb/s.
OutputVGA DAC (10-bit triple DACs).Up to 1600x1200 at 100-Hz.
USB Basics
Host and ClientHost 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
TerminologySpeed - 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 DescriptorsDevice 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 connectedHost 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 connectedHost 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 connectedHost 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 connectedProbe 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 connectedHost 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
Typical data transfer in Bulk mode.
PTD 1 PTD 2 PTD 3
Nios to Host Nios to Host Host to Nios
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 and device initialization: Init ATL, ISTL0/1 and INT buffers. Init USB port1 and port2.Enter operational mode.Detect device connection.Enable connected port1.EnumerateGet device description.Configure device.
ControlTransfer
mode
HostRegister
setup
Project Timeline
Week Progress Challenges
1Explored development
environment
2Examined USB Host protocol
example of mouse specific functions.
No isochronous transfer support.
3Learned basic USB 1.1
Controller (Phillips ISP1362) Interface
4-5
Learned Webcam USB Protocol specification,
Descriptors and Video class requests.
Project Timeline
6-9Adapted Mouse example to
work with webcam.
No success with ISO traffic. Very slow progress due to inconsistent
code in mouse example and lack of compatibility with webcam.
10-11Software and hardware debug
of USB protocol, to try and correct main issues.
12-13
All project rewrote from scratch using only relevant code and
consistent with embedded programming guide.
Week Progress Challenges
References
Philips Embedded Programming guide Philips ISP 1362 Data Sheet USB 2.0 Specification USB Video Class Specification USB Complete by Jan Axelson Google