Q - Microchip
[pic]
|Categories |
|USB Overview |Getting Started/Tools |USB Device/Peripheral |
|USB Embedded Host |USB On-The-Go |USB Certification |
Click on the question below to see the answer.
|USB Overview |
|1. What are the differences between USB 1.1 and USB 2.0? |
|2. Is there a difference between Hi-Speed USB and USB 2.0? Which is the correct nomenclature? |
|3. How fast an USB device can communicate with a computer using USB? |
|4. What is a USB Host? |
|5. I have heard the terms USB Device, peripheral, and Function. What are the differences and what is the correct usage of |
|terms? |
|6. How many devices can be connected to one host? |
|7. What is USB Hub? |
|8. How many hubs can be chained together? |
|9. Is there body that owns and controls the USB specification? |
|10. How is data transferred in USB protocol? |
|11. What is a token packet? |
|12. How does USB protocol detect an error in communication? |
|13. What happens if the SIE receives data that is corrupted? |
|14. What is difference between transfer & transaction in USB protocol? |
|15. What is the largest data packet that I can send? |
|16. What is Enumeration process? |
|17. How does USB host identify speed of USB device? |
|18. How does the USB host reset the USB device? |
|19. If the USB host issues a reset command for a particular USB device, will it also reset other connected USB devices? |
|20. How does USB host find out the name of connected USB device? |
|21. What is device descriptor? |
|22. What is VID & PID? |
|23. Do I have to purchase my own VID? Does Microchip sublicense their VID? |
|24. Do I need a new PID for each device that I produce? |
|25. Can there be contention when two USB devices are connected simultaneously to USB Host? |
| |
|Getting Started/ Tools |
|26. What are the development tools offered by Microchip for USB? |
|27. Where can I buy samples, C compiler, tools etc? |
|28. What are different types of C compilers available? |
|29. Where can I get all the software? |
|30. Where can I find some precompiled demos for evaluation without having to modify or compile code? |
|31. How what are the resource requirements for the USB stack? |
| |
|USB Device/Peripheral |
|32. How does a USB hub slow down devices? |
|33. What are the Device classes supported by Microchip? |
|34. What can be maximum cable length between two hubs or two USB devices? |
|35. What is difference between “composite” USB device & “compound” USB device? |
|36. Does Microchip custom USB Driver support Windows Vista? |
|37. What can be maximum capacitance across Vbus pin of a USB device? Why? |
|38. What care should be taken when USB device is self powered? |
|39. What should I specify in my configuration descriptor if I want to be either bus powered or self powered, depending on the |
|situation? |
|40. Why do I need INF file while using CDC where as I do not need anything at PC side while using HID class? |
| |
|USB Embedded Host |
|41. What is the difference between a Host, Embedded Host, limited host and mini-host? |
|42. Does Microchip supply all the stacks required for a complete thumb drive application? |
|43. What are the Device classes supported by Microchip? |
|44. Can a high speed peripheral, like a hard drive, be connected to a full speed host? |
|45. So any hard drive would work with any host? |
|46. If I am an embedded host then do I need to support Session Request Protocol (SRP) and Host Negotiation Protocol (HNP)? |
| |
|USB On-The-Go (OTG) |
|47. What is OTG and why was it developed? |
|48. If I only want to talk to USB devices (peripherals), do I need to be an OTG product? |
|49. Does USB OTG have to be in both products in order to connect and operate? |
|50. Does USB OTG eliminate the need for a PC? |
|51. What is the Host Negotiation Protocol (HNP)? |
|52. What is the Session Request Protocol (SRP)? |
|53. What happens when you plug two USB OTG devices together? |
|54. What connectors are used for OTG? |
|55. I want to be either an embedded host or a USB device(peripheral) but I don’t need/want to dynamically switch between the |
|two. Is this possible and what connectors should I use? |
| |
|USB Certification |
|56. What are the peripheral silicon TID #’s from the USB-IF for each Microchip USB Microcontroller? |
USB Overview
What are the differences between USB 1.1 and USB 2.0?
Finalized in 2001, USB 2.0 is an external bus that supports data rates up to 480Mbps. USB 2.0 is an extension of USB 1.1. USB 2.0 is compatible with USB 1.1. USB 2.0 cables and connectors will work with USB 1.1 devices. Not all USB 1.1 cables may work with USB 2.0 devices.
(top)
Is there a difference between Hi-Speed USB and USB 2.0? Which is the correct nomenclature?
There is a difference between the terms Hi-Speed USB and USB 2.0. The difference is that USB 2.0 is the specification. "Hi-Speed USB" refers to just the 480 Mbps portion of the USB 2.0 specification. A device can still be USB 2.0 compliant and be full speed or low speed.
(top)
How fast an USB device can communicate with a computer using USB?
USB 2.0 supports 1.5Mb/S,12Mb/S, and 480Mb/S speeds which are known as Low Speed, Full Speed, and High Speed respectively.
(top)
What is a USB Host?
The Host is the root of the USB tiered star network. It controls the bus and communication is initiated by USB Host. The USB protocol mandates a single Host in any USB system.
(top)
I have heard the terms USB Device, peripheral, and Function. What are the differences and what is the correct usage of terms?
The definition found in the USB specification for device notes the ambiguity in the word. The specification details that a “USB device” is either a hub or a function. When using the term “USB Device” should be used in place of “device” to help reduce the ambiguity. Even with the clarification of “USB Device”, some publications use the term “USB Device” when they are referring to any USB enabled device. Because of this inconsistency of term usage, peripheral may be a less ambiguous wording option.
The USB specification does not define the term peripheral in its definitions list but uses it throughout the specification interchangeably for USB device. The USB certification checklists for USB devices are also called the peripheral checklists.
The definition for Function in the USB specification says that a function is a USB device that provides some type of capability to the host.
(top)
How many devices can be connected to one host?
Each host controller can support up to 127 devices. A host may contain multiple host controllers. The presence of root hubs and/or compound devices may change, based on their implementation, the total available physical devices. Hubs also count as a device on the bus so each hub will also reduce the number of available USB device/peripheral slots.
(top)
What is USB Hub?
A USB Hub is a USB device that allows other devices to attach to it, thus expanding the size of the network. Hubs can be either bus or self powered. A bus powered HUB cannot provide maximum power to all connected USB device but a self powered USB HUB can provide maximum power to each connected USB device. Since an USB device can expect minimum 100mAmp from USB Hub and maximum of 500mAmp per USB port, the bus powered USB hub can have maximum four down stream devices.
(top)
How many hubs can be chained together?
You can connect a maximum 5 hubs in a single chain.
(top)
Is there body that owns and controls the USB specification?
Yes, USB implementers forum also known as USB-IF. Their official website is from where you can download latest specification for USB which is freely downloadable.
(top)
How is data transferred in USB protocol?
USB Specification defines four different types of data transfers mechanisms.
Control Transfer
The USB Host sends commands & query to USB device using Control transfer. The Control transfer uses End point 0(EP0) while USB device is being enumerated and thus it is mandatory to support EP0 by all USB device irrespective of supported speed. The maximum size for a Control packet is 8, 16, 32 or 64 bytes. The packet length of Control transfer in Low-speed USB device must be 8Bytes, for Full-speed USB device must be 64Bytes and for High-speed USB device allows 8, 16, 32 or 64Bytes.
Interrupt Transfer
Interrupt transfers are a method for a USB device to request a certain polling rate from the USB host. The polling time is requested to USB Host by USB device during enumeration process. The maximum polling rate for a full-speed device is once per millisecond and once per every 10 milliseconds on low speed devices. The maximum data payload size for Low-speed USB device is 8Bytes, for Full-speed USB device is 64Bytes. This results in a maximum throughput of 64KB/Sec and 800B/Sec is for Low-speed USB device. Interrupt transfers are acknowledged so they guarantee the delivery. If a packet fails to arrive it is retried.
Bulk Transfer
Bulk transfers are a way for devices to transfers large amounts of data but as a consequence do not guarantee timely delivery. Bulk transfers have the lowest priority when it comes to scheduling on the bus. After all other transfers are complete the reset of the remaining bandwidth is given to bulk transfers. Just like interrupt transfers, bulk transfers are acknowledged to guarantee their delivery. Bulk transfers are only supported by Full-speed and High-speed devices. For Full-speed USB device endpoints, the maximum packet size can either be 8, 16, 32 or 64 bytes long. For High-speed USB device endpoints, the maximum packet size can be up to 512 bytes long.
Isochronous Transfer
It provides guarantee of transfer rate. A Full-speed isochronous transaction can send 1023 bytes per frame. Isochronous transfers are not acknowledged. It is possible that isochronous packets will not arrive. A typical application for isochronous transfers is audio/video streaming where it is more important to keep the video and audio up to date at the expense of dropping packets. The maximum transfer rate can be 1023KB/Sec for Full-speed USB device.
(top)
What is a token packet?
USB protocol defines four types of packets:
Start of Frame
Token
Data
Handshake
There are three different types of Token packets.
IN ---- Informs the USB device that the host wants to read information
OUT---Informs the USB device that the host wants to send the information
Setup—Used to indicate to the device that a control transfer is about to occur.
(top)
How does USB protocol detect an error in communication?
USB protocol detects error using CRC (Cyclic Redundancy Check). This is done by the SIE (Serial Interface Engine), thus eliminating the need of CRC check in software and reduces the software overhead. For token packet CRC is 5 bit & data packet CRC is 16 bits.
(top)
What happens if the SIE receives data that is corrupted?
The SIE discards the corrupt packet if the packet fails the CRC checks. No software intervention is required. An error flag is set indicating that a corrupted packet was received. The SIE will not ACK packets that have incorrect CRC values. For interrupt, bulk, and control transfers the host will try to retransmit the packet if it fails to receive the ACK. In this way these transmissions will not have data loss due to a corrupted packet but may suffer from lower application bandwidth.
(top)
What is difference between transfer & transaction in USB protocol?
Transfers are groups of transactions and transactions are groups of packets.
(top)
What is the largest data packet that I can send?
It depends on type of transferred used. Interrupt & Bulk transfers have a maximum payload size of 64 bytes for full-speed USB devices. Isochronous transfers can send up to 1023 bytes for full-speed USB devices.
(top)
What is Enumeration process?
It is the process by which USB host learns about a USB device that has just been connected to the bus. Before the application is able to start running, the host queries the device for various information to determine what type of device it is, what device driver it needs to load for the device, what power requirements the device has, etc. During the enumeration process the USB host also assigns an address to the connected device. After the address is set the USB host will communicate to the device at that address from that point forward. On of the final tasks of the enumeration process is to set the device into a specific operational configuration. A detailed enumeration process is given in section 9.1.2 of USB specification.
(top)
How does USB host identify speed of USB device?
The USB host has weak pull down resistors on both of the communication lines (D+ and D-). A device will pull up D+ with a stronger pull-up resistor if it wishes to run in full-speed. If a device wishes to run in low-speed then D- is pulled up instead. The value of pull up resistor in each case is nominally 1K5.
(top)
How does the USB host reset the USB device?
The USB host sends a reset to the device by setting D+ and D– low for at least 10 milliseconds. A USB device is allowed to determine that reset has occurred if it sees that D+ and D- are low for more than 2.5 microseconds. Once the USB device detects the reset, it goes into default state as soon as the USB host removes the reset. This reset is a USB reset only and does not reset the controller.
(top)
If the USB host issues a reset command for a particular USB device, will it also reset other connected USB devices?
No. The USB host will request that a hub reset the particular connected USB device and only that device will be reset. If the USB host resets the hub itself then all of the devices attached to the hub will be reset.
(top)
How does USB host find out the name of connected USB device?
There are several strings located in the device descriptor of the USB device, one of which being the manufacturer string. These strings, if implemented, can be read by the USB host during the enumeration process.
(top)
What is device descriptor?
The device descriptor is data table that describes various information about the attached device, such as the vender ID (VID) and product ID (PID) of the manufacturer. The complete contents of the device descriptor can be found in Table 9-8 of the USB specification.
(top)
What is VID & PID?
VID stands for Vendor ID & PID stands for Product ID. The VID is issued by USB-IF by paying a required fee. USB-IF mandates each vender have their own VID in order to market their product. There are possibly both legal and technical complications involved when using a VID/PID that is not unique.
VID can be obtained from
Once a VID has been purchased, how the PIDs are used within that VID are determined by the manufacturer.
(top)
Do I have to purchase my own VID? Does Microchip sublicense their VID?
Microchip does have a sublicensing program for its VID. Please visit usb under Support and Training for more information about how to obtain a PID with Microchip’s VID.
(top)
Do I need a new PID for each device that I produce?
A new PID is required for each product line produced. Each identical product in that product line should have the same PID. If each device in a product line requires a unique identifier then the iSerialNumber field of the device descriptor can be used to uniquely identify each device.
(top)
Can there be contention when two USB devices are connected simultaneously to USB Host?
No. The host resets one device at a time and then completes the enumeration of one device before it starts investigating the next device.
(top)
Getting Started/ Tools
What are the development tools offered by Microchip for USB?
More information about the various USB development and evaluation platforms is available on the “Tools” page.
(top)
Where can I buy samples, C compiler, tools etc?
You can buy all them from Microchip Direct ().
(top)
What are different types of C compilers available?
Microchip offers compilers as follows:
PIC18F USB family microcontrollers – C18
PIC24F USB family microcontrollers – C30
PIC32MX USB family microcontrollers – C32
The above mentioned compilers are available in 2 forms – licensed version and student version. Please refer to the specific compilers documentation for the limitations on the student versions.
(top)
Where can I get all the software?
All the USB software is available at Software/Tools
(top)
Where can I find some precompiled demos for evaluation without having to modify or compile code?
For the USB firmware release v2.1 or later precompiled demos can be found in the “\USB – Precompiled Demos” directory. Documentation is also available in that directory to describe what hardware is required to run the demos, how to load the firmware into the device, and how to run the demo.
(top)
How what are the resource requirements for the USB stack?
Resource requirements vary depending on the compiler, the processor family, the USB operational mode (Host, USB Device, OTG, etc), the USB class/function driver in use, etc. The resource requirements may also vary between release versions of the USB firmware.
Please refer to the release notes of a specific release for the estimated sizes of several combinations of the possible variables.
(top)
USB Device/Peripheral
How does a USB hub slow down devices?
USB hub has to re-calculate the time left before the end of the frame. The small extra delay added by the hub will decrease the available bandwidth. If several devices are connected on the hub and working in parallel (for example, a webcam + a USB flash drive + a mouse), then the USB bandwidth is shared among the devices usage.
(top)
What are the Device classes supported by Microchip?
Currently Microchip supports evaluation USB device versions of HID (Human Interface Device - keyboard, joy stick, mouse etc are examples), CDC (Communication Device – modem, Ethernet adapter etc. are examples), MSD (Mass Storage Device – thumb drive, external hard disk etc. are examples), and Custom device classes – customers can develop their drivers uniquely for their devices.
Please refer to the release notes of the specific software release for more information about the device class support.
(top)
What can be maximum cable length between two hubs or two USB devices?
The maximum length of USB cable is 5 meters.
(top)
What is difference between “composite” USB device & “compound” USB device?
A “compound” USB device is one with that has a built in hub, in addition to one or more USB peripherals devices, all built into a single product with only one USB cable connecting it to the host.
A “composite” USB device does not use hub silicon. It uses more than one interface in a single peripheral device. Currently, Microchip’s Full Speed USB silicon can be used to develop composite USB devices but not compound devices.
(top)
Does Microchip custom USB Driver support Windows Vista?
Release versions 1.3 and later contain an updated driver that works on Windows Vista (both 32 and 64 bit versions).
(top)
What can be maximum capacitance across Vbus pin of a USB device? Why?
The maximum capacitance as seen by the Vbus pin of the USB connector must be less than 10uF.
This is to limit the inrush current that goes into the device when it is plugged into the device. The purpose of limiting the inrush current is to limit the drop in the Vbus voltage due to the charging of the capacitors on the newly attached device. Without limiting the inrush current of hot-plugged devices, a newly attached device may cause other devices to stop working.
If an application requires more capacitance than the spec allows, a soft-start circuit is required to limit the inrush current to the specified limits.
(top)
What care should be taken when USB device is self powered?
If the device is self powered, an I/O pin must be used to detect a cable attachment. The D+ or D- line must not be pulled up until USB host drives the Vbus high.
A self powered device must also consistently specify that it is self powered. If the configuration descriptor says that it is self powered then any GET_STATUS requests to the device must also return self-powered.
(top)
What should I specify in my configuration descriptor if I want to be either bus powered or self powered, depending on the situation?
If the device wishes to be bus powered at all, even if it self powered part of the time, then it must declare itself as a bus powered device.
The GET_STATUS request should accurately reflect to the host if the USB device is currently running on self power or bus power.
(top)
Why do I need INF file while using CDC where as I do not need anything at PC side while using HID class?
The CDC class has many other sub class specifications. The host needs to know which of these device drivers to load for the attached device. This information is contained in the .INF file. This means that the host will require some installation/setup process when a new CDC device is attached for the first time.
(top)
USB Embedded Host
What is the difference between a Host, Embedded Host, limited host and mini-host?
Hosts are almost always referred in context to PCs and laptops where any USB peripheral can be plugged. Full host must source 500mA of current on the Vbus to power the peripheral devices connected to it.
Embedded hosts are always found in small form factor and portable devices like a set top box, PDA, etc. It has to source current of minimum 8mA on the Vbus. It has limited memory space to store limited drivers, thus the connectivity to peripheral is also limited. Unlike a full host the embedded host is not required to load device drivers for a device it does not support. It is required, however, to notify the user that an unsupported device was attached.
Embedded hosts are often called “mini-Hosts” or “limited hosts” but they refer to the same type of device. The terms embedded host, mini-host, or limited host are not referred to in the USB specification or the OTG supplement. The certification procedural walkthrough refers to these devices as Embedded hosts.
(top)
Does Microchip supply all the stacks required for a complete thumb drive application?
Yes. Microchip provides the USB mass storage class drivers, the SCSI interface, the FAT16/32 format software, and an example file management application. This firmware is available in Software/Tools
(top)
What are the Device classes supported by Microchip?
Currently the embedded host stack supports the MSD (Mass Storage Device – thumb drive, external hard disk etc. are examples), and Custom device classes – customers can develop their drivers uniquely for their devices.
Please refer to the release notes of the specific version for more information about software support.
(top)
Can a high speed peripheral, like a hard drive, be connected to a full speed host?
Yes. The USB protocol requires all full speed and high speed communication to initiate as full speed, and then scale up to high speed if both devices support it. In the case that one of the devices supports full speed only, the communication would be limited to full speed, 12 Mbps.
(top)
So any hard drive would work with any host?
No. Hard drives are mass storage devices, and as such have some form of data format provisions. For the devices to work, as opposed to just recognize each other, the file and interface protocols must also match. For example, a Thumb drive is a basic mass storage application. But for it to function, the USB class drivers, the SCSI interface, and the FAT16 format must all be present.
Currently only the FAT16 file format is supported in the USB embedded host firmware release versions. FAT32 support is being developed. NTFS and other file systems are not supported.
(top)
If I am an embedded host then do I need to support Session Request Protocol (SRP) and Host Negotiation Protocol (HNP)?
For an embedded host SRP is an optional feature but is not required. In most cases it is probably not desired either. For more information about what SRP is please see the OTG section of this FAQ.
Since an embedded host is only capable of being a host and never a USB device, HNP should not be supported. For more information about what HNP is please see the OTG section of this FAQ.
(top)
USB On-The-Go (OTG)
What is OTG and why was it developed?
The OTG specification is an addendum to the original USB specification. USB OTG defines a way for portable devices, through only one connector per device, to connect to supported USB products in addition to the PC. This allows to mobile device to connect to each other. One will assume the role of embedded host and the other will assume the role of USB device. This eliminates the need to have a PC for specific USB applications.
(top)
If I only want to talk to USB devices (peripherals), do I need to be an OTG product?
If a device only needs to talk to USB devices and never attach to another USB host, then the device can be an embedded host instead of an OTG product (please refer to the embedded host section above). If a device needs to connect to both USB devices and USB hosts then it needs to be an OTG product.
(top)
Does USB OTG have to be in both products in order to connect and operate?
No, USB OTG products will connect to all PCs, and will also have host functionality to connect to the specific USB peripherals it supports.
(top)
Does USB OTG eliminate the need for a PC?
No. In fact, USB OTG complements the concept of the “Extended PC”, where the PC is at the center of the consumer’s extended world of digital devices. By enabling basic functions between digital devices, USB OTG augments the capability of these PC peripherals, making them more valuable to consumers and corporate users.
(top)
What is the Host Negotiation Protocol (HNP)?
USB OTG devices determine which device is the host and which device is the peripheral based on which end of the cable is attached to the device. If operation requires that the roles be switch HNP provides a mechanism for switching that role without having to remove and switch ends of the cable.
(top)
What is the Session Request Protocol (SRP)?
Unlike other USB hosts, USB OTG devices are allowed to remove power from the Vbus line when they are not using it. The time when Vbus is powered is referred to as a session. SRP is a method for which a device attached to an OTG product can request a new session be started. After a device signals SRP, the OTG product acting as host will then power up Vbus and start communicating with the device.
(top)
What happens when you plug two USB OTG devices together?
When two dual role devices get connected together via a cable, the cable sets a default host and default peripheral. If the application is such that the roles need to be reversed, then the Host Negotiation Protocol (HNP) can provide a handshake that performs that function. If HNP is not supported in either device then the cable may need to be reversed if a specific role is required.
(top)
What connectors are used for OTG?
OTG devices that are not already in production should use a micro-A/B connector. This allows either an A end or B end of a micro cable to be attached. This connector should not be confused with the micro-B connector that is available for USB devices.
(top)
I want to be either an embedded host or a USB device(peripheral) but I don’t need/want to dynamically switch between the two. Is this possible and what connectors should I use?
Yes, this is possible. There are two possible ways to tackle this problem.
The first solution is to use the micro-A/B connector and program the device as an OTG device. Because SRP and HNP are optional these features can be disabled. The limitation here is that USB devices with full size A connectors will need an adaptor to connect to the micro-A/B port on the device.
Alternatively the device can have two USB connectors. Each would have to have it’s own separate circuitry for Vbus but share D+ and D-. The limitation here is that the USB test specifications state that any connectors that are accessible to the user must all be functional at the same time. Since the current USB devices only support one USB port, it is not possible to have both connectors functional at the same time. This means that some sort of mechanical feature must be implemented such that only one of the two ports is accessible for use at any given point of time.
(top)
USB Certification
What are the peripheral silicon TID#s from the USB-IF for each Microchip USB microcontroller?
USB Compliant Testing ID
|Product Family |TID # |
|PIC32MX460F512L Plug in Module |10750054 |
|PIC32MX795F512L Plug in Module |10750055 |
|PIC18F2455/2458/2550/2553/4455/4458/4550/4553 |40002568 |
|PIC18F87J50/86J55/86J50/85J50/67J50/66J55/66J50/65J50 |40000369 |
|PIC24FJ256GB110/108/106, PIC24FJ192GB110/108/106, |40000566 |
|PIC24FJ128 GB110/108/106, PIC24FJ 64GB110/108/106 | |
|PIC18F2450/4450 |40000174 |
(top)
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.