PORTS Forum

Ports and Interfaces => USB => Topic started by: titan_amit on May 17, 2011, 03:27:38 am

Title: Criterion for a general purpose micro controller to be used as USB host control
Post by: titan_amit on May 17, 2011, 03:27:38 am
Can we use a general purpose micro controller like 8051 to develop a USB host controller. If not why? If its possible to develop a USB host controller using a uc, what are the features uc must have?
Title: Re: Criterion for a general purpose micro controller to be used as USB host control
Post by: Jan Axelson on May 17, 2011, 10:21:15 am
Yes, if you interface it to a host chip such as PLX  OXU210HP, Maxim MAX3421E, FTDI Vinculum, GHI Electronics USBwiz.

Jan
Title: Re: Criterion for a general purpose micro controller to be used as USB host control
Post by: titan_amit on May 20, 2011, 02:29:30 am
Ma'm is it possible to implement the host chip inside the micro controller. If no why?
Title: Re: Criterion for a general purpose micro controller to be used as USB host control
Post by: Jan Axelson on May 20, 2011, 09:55:01 am
You need host-controller hardware either in the chip or on an external chip. If you want to see what host-controller hardware consists of, take a look at PLX or Maxim chips I mentioned.

Jan
Title: Re: Criterion for a general purpose micro controller to be used as USB host control
Post by: titan_amit on June 05, 2011, 05:22:32 am
Hii ma'm

As you suggested i looked into the details of hardware of host controller chips and the only thing that i found special in them (apart from buffers and some special function registers) was Serial interface Engine(SIE). As far as i understood that SIE does all the basic functions like CRC calculation, bit stuffing etc., but my doubt is, isn't it possible to implement these functions in software inside a general purpose micro controller. Please guide me if i am wrong.
Title: Re: Criterion for a general purpose micro controller to be used as USB host control
Post by: Pat Crowe on June 05, 2011, 06:01:25 am
The most time-critical task you would have to perform is recovering the clock from the incoming upstream data.

Remember that the incoming data is not synchronised to your own clock, and that several bit time will occur without data transitions. Recovering the clock is most simply implemented as dedicated hardware, that was what was intended by the spec. Recovering the clock in software requires sampling it at several times the bit rate and implementing a software digital phase-locked loop. Assuming Full Speed, the minimum sample rate would be 48 MHz.

At the same time as recovering the clock you would, of course, have to be reading and storing one complete packet's worth of data, for subsequent decoding.

Have a go at defining the software you would need to do this and I suspect you will become aware of the problem.

It is really a case of 'why try to do something the hard way?'.
Title: Re: Criterion for a general purpose micro controller to be used as USB host control
Post by: dhouston on September 18, 2011, 09:49:12 am
Does anyone know of a host chip which uses SPI, like the MAX3421E, but can work at 3.3V & 5V?
Title: Re: Criterion for a general purpose micro controller to be used as USB host control
Post by: dhouston on September 20, 2011, 04:25:46 pm
Does the latest edition of USB Complete cover the data flow when using something like the MAX3421E with an embedded µC?
Title: Re: Criterion for a general purpose micro controller to be used as USB host control
Post by: Jan Axelson on September 20, 2011, 04:56:19 pm
USB Complete doesn't have MAX3421E-specific info.

My USB Embedded Hosts book will be out in November. It covers USB embedded host communications with example code for embedded Linux systems. More info is here:

http://www.lvr.com/usb_embedded_hosts.htm

Jan
Title: Re: Criterion for a general purpose micro controller to be used as USB host control
Post by: dhouston on September 20, 2011, 07:35:51 pm
Thank you. I had the first edition (plus 3 books other of yours) and it looks like I can save the cost of the latest edition and order the USB Embedded Hosts, instead. The sample Chapter 2 looks like this is exactly what I'll need. Amazon, here I come.

Initially, I have only a single (self-powered) device to support and, as it's about 7 years old, suspect it's low speed. Others have already reverse engineered most of its communications protocol. I'll be using an AVR µC but your Linux code will likely be helpful. I'm designing my PCB now and think I can do that with current knowledge.

Later, I plan an Arduino form factor board that can support all the things the MAX3421E can do. But, it will mostly be up to Arduino aficianados to decide what and how it interfaces with other hardware.
Title: Re: Criterion for a general purpose micro controller to be used as USB host control
Post by: dhouston on September 21, 2011, 07:15:43 pm
I would like to design my PCB (actually, revise a preliminary design) without waiting for your book. However, while the MAX3421E datasheet shows 3-4 variations on host/peripheral, it does not show a Host with a Self-powered Peripheral which is what I need. From the diagrams that are in the datasheet, I've drawn the schematic below (EDIT: modified after Jan's comment). I would appreciate your comments/corrections.
(http://davehouston.org/max4321e.png)
I need to connect to...
Title: Re: Criterion for a general purpose micro controller to be used as USB host control
Post by: Jan Axelson on September 22, 2011, 09:04:36 am
Even for self-powered devices, the host has to provide VBUS to power the pullup on D+ or D- for device detection.

The challenge with using an interface chip like Maxim's is obtaining host firmware for the system processor, not just the host controller driver but also drivers for the supported devices.

Jan
Title: Re: Criterion for a general purpose micro controller to be used as USB host control
Post by: dhouston on October 05, 2011, 09:13:06 am
I have revised my schematic to include switched +5V to VBus. However, I have two more questions.

1. I only want to host a specific peripheral which has a cable with A on the host end and B on the peripheral end. Due to limited space I cannot use an A connector on my PCB (Arduino shield form factor) and will need to use a mini USB-AB connector. I can find a cable with the needed connectors on the ends but what do I do with the ID connection?

2. My project needs to work with 3V3 or 5V supply. How do I provide VBus from 3V3 power? I do have 3 MAX3232 ICs on the PCB - can I use those to supply VBus?
Title: Re: Criterion for a general purpose micro controller to be used as USB host control
Post by: Jan Axelson on October 05, 2011, 10:10:01 am
Use a step-up regulator to provide VBUS. The USB-IF's Embedded Host spec says that an embedded host should provide 8 mA or the amount of current required by supported peripherals, whichever is larger.

The Mini-AB (now Micro-AB) receptacle is intended for use on OTG systems. The ID pin tells the system whether an A-series or B-series plug is attached. The system could display a message if the user attaches a series-B plug.

The Embedded Hosts spec is included in the USB 2.0 spec's zip file.

Jan