Channels ▼

Al Williams

Dr. Dobb's Bloggers

Hosting USB

December 11, 2014

I've mentioned using Microchip PICs or Arduino Leonardo to work as USB clients. The truth is, though, that for many designs, it is just as easy to let the USB port pretend to be a serial port and then use the serial port drivers for your operating system to talk to the device.

What would be really interesting, though, is an easy way to act as a USB host. Using a USB drive for data logging storage is an obvious application. A USB keyboard or mouse might form a user interface or — with modifications — act as a sensor (I can imagine a CNC table with an optical mouse sensing position, for example).

If you want an all-in-one solution for doing USB to serial, you've probably found FTDI's offerings. They have a series of easy-to-use ICs and modules that look like a serial port to your design and a USB device to the host computer. It isn't surprising, then, that they also offer a solution for USB host duties. That solution is known as Vinculum.

You can get Vinculum as an IC or bundled in a module. There are several modules, but I picked up the VDrive3. It is an attractive little plastic enclosure with a USB jack on the face and some wires coming out the back. You should be able to connect a USB device to the front and your microcontroller to the back and be in business.

My experience so far has not been very good. In all fairness, maybe I've missed some key documentation, but I don't think I have. The hardware by itself does nothing. However, it is preloaded with one particular FTDI-provided firmware. You can load different firmware if you prefer. That leads to the first problem. To get to the documentation that you really want, you have to find the firmware documentation, not the hardware documentation.

When you find the firmware documentation, it appears to be for an older device (VDAP), but there is an application note that explains the differences between the old firmware and the new (V2DAP). There are some application notes that show the device being used but no real reference or tutorial type documentation. The User's Manual is the best thing I can find, even though it is out of date. It also discusses the different firmware available (and, of course, you are free to write your own from scratch if you want).

However, the manual has been only part of the problem. The device seems to think you will connect to it with an ASCII terminal and type commands to it. It has verbose messages and commands. However, you can shift to a short command mode and even a binary numeric mode. Although the chip starts in long command mode, it also starts in binary numeric mode. So while you can read the messages, the numbers come out as garbage.

For my purposes, I really wanted to be in an efficient machine-friendly format. That takes a few commands (and parsing of the prompt). It isn't impossible, of course, but it is strange for something clearly meant to interface to an embedded system. It reminded me of talking to a modem that was never quite sure you were not personally typing commands to it.

In addition, I found the USB connection unreliable. Again, this could be my fault, but some USB sticks would not read reliably even though they work fine on a Linux or Windows machine. If I were integrating this into a real product, that would be unacceptable.

I wanted to like the Vinculum. I really did. If it worked reliably, the software would be just painful and not a showstopper. The documentation — or, at least, what I found of it — was abysmal. It is a real shame. I've been so impressed with many of FTDI's other offerings that I expected better from Vinculum.

I was going to post some code, but with the problems the device has exhibited, I'll wait a bit and see if I can make it work any better. Meanwhile, if you've used the device yourself, leave a comment and share your experience, good or bad.

Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.