Skip to main content

Essential USB Specifications and Develop embedded systems with USB

Universal Serial Bus (USB) allows peripherals and computers to interconnect using standard protocol and provide plug and play feature to the devices. At the moment there are 2 specifications available for USB they are,

USB 1.1 : In this specification data transfer rate is 12Mbps and 1.5Mbps.


USB 2.0 : Support data transfer rate up to 480Mbps.


Both these specifications support up to 127 devices and support for hot swapping (no need to power down to remove or connect the devices). In USB devices are categorized as a classes and each class represent the functionality that target device can provided to the host device. For example:

AUDIO : Audio and related systems


HID : Human Interface Devices. (E.g: Keyboard, Mouse, etc)


POWER: Devices related with the power such as UPS systems.


IrDA: Infrared devices.


There are 4 types of transfers take place over USB,


Control transfer : Used to configure the bus and devices on the bus.


Bulk transfer : Move data asynchronously over USB.


Isochronous transfer: Transfer time critical data and support for unidirectional transfers only.


Interrupt transfer: Used to retrieve data in regular intervals. (Generally from 1 to 255ms)


In a USB architecture data is transferred using packets and each packet contains synchronization byte, Packet ID (PID), contents and CRC (Cyclic redundancy check data) There are 4 packet types available in USB and they are,


Token Packets : 24bit packet that determine the type of a transfer that is take place over the bus.


Data Packet : Can transfer between 0 to 1023 bytes and also have 16bit CRC stage.


Handshaking Packet : Which is used to acknowledge the end to end data transfer.


Descriptor : Contain the device capabilities such as product identifier, manufacture code, class type, internal configuration, etc.


USB devices uses shielded four wires, cable to interconnect the devices. Data transfer is take place at D+ and D- (similar to RS422/485 specification) and other remaining 2 wires carrying power (+5V and 0V) to the device. D+ signal has a 15K pull-down resistor to the ground and D- has a 1.5K pull-up resistor to +3.6V power line.



PinColorFunction
1Red+5V
2WhiteD-
3GreenD+
4BlackGND


In embedded systems there mainly two methods to implement USB interfaces,


Using standard bus interface: Most recommended devices are FT245, FT232 and USS820.


Using USB to SPI bridge: Most recommended device is ATMEL AT76C711 AVR microcontroller.


When designing embedded systems using USB we need to take special care about,


Noise : To prevent external noises designer need to add ferrite bead to the USB cable. Generally the value of the ferrite bead is depends on the total current required by the circuit.


Power Source : Need to provide well regulated power source to the device. Generally we use 7805 regulator to provide +5V to the USB interface and LM1086-3.3 to provide +3.3V power source to the system/device.


Double check the power lines (especially if you are working with FT245, FT232 and USS820 devices) and voltage ratings. Improper power connections and voltage levels may burn the chips and ports instantly.

Comments

Popular posts from this blog

CD2003 - yet another simple FM radio receiver

In the last few days, we are looking for some simple FM radio receiver to integrate into one of our ongoing projects. For that, we try several FM radio receiver ICs including TDA7000, CD2003/TA2003/TA8164, CXA1019, and KA22429. Out of all those chips we select CD2003 (or TA2003/TA8164) based receiver for our project because of its simplicity and outstanding performance. Except to CD2003, Sony CXA1019 also perform well but we drop it because of its higher component count. We design our receiver based on Toshiba TA2003 datasheet and later we try TA8164 and CD2003 with the same circuit. Either CD2003 or TA8164 can directly replace TA2003 IC, and as per our observations, TA8164 gives excellent results out of those 3 chips. A prototype version of CD2003 FM radio receiver The PCB design and schematic which we used in our prototype project are available to download at google drive (including pin-outs of crystal filters and inductors ). Except for CD2003 IC, this receiver consist

Arduino superheterodyne receiver

In this project, we extend the shortwave superheterodyne receiver we developed a few years ago . Like the previous design, this receiver operates on the traditional superheterodyne principle.  In this upgrade, we enhanced the local oscillator with Si5351 clock generator module and Arduino control circuit. Compared to the old design, this new receiver uses an improved version of an intermediate frequency amplifier with 3 I.F transformers. In this new design, we divide this receiver into several blocks, which include, mixer with a detector, a local oscillator, and an I.F amplifier. The I.F amplifier builds into one PCB. The filter stage, mixer, and detector stages place in another PCB. Prototype version of 455kHz I.F amplifier. In this prototype build, the Si5351 clock generator drives using an Arduino Uno board. With the given sketch, the user can tune and switch the shortwave meter bands using a rotary encoder. The supplied sketch support clock generation from 5205kHz (tuner frequ

Calculator for audio output transformers

Audio output transformers are heavily used in a vacuum tube and some (older) transistor base audio power amplifiers, but these days output transformer are quite hard to find and expensive item. For homebrew projects, the best option is to construct those transformers by ourselves and this script helps to calculate winding parameters for those transformers. This " AF output transformer calculator " script is written using Python and it works with most of the commonly available Python interpreters . The script is available to download at google drive under the terms of GNU General Public License version 3.0 . Homebrewed 25k: 4 output transformer Once supplied the input parameters this script provides a winding ratio, the number of turns required for primary and secondary winding and required copper wire gauges for both primary and secondary windings, etc. We construct several AF output transformers based on results of this script, which including transformers for M