Channels ▼

Al Williams

Dr. Dobb's Bloggers

YouSB

January 23, 2012

I've used microcontrollers to produce lots of "coprocessors" — CPUs with a serial interface that do a very specific task (like floating point math or PWM generation) for another CPU. That seems to be the idea behind the Microchip MCP2210. This chip handles all the USB work for your main processor and you simply communicate with it over an SPI serial connection. The device is inexpensive and looks to be easy to use.

Unlike most coprocessors, however, the MCP2210 is the SPI bus master. It can send and receive data from the host computer to one of 9 SPI devices (including another CPU). It also alerts your device of significant USB events like suspend, resume, and low power. Looks like a pretty easy way to add USB to a non-USB CPU. Note you still have to program your VID and PID into the device (or borrow one from Microchip).

On the other hand, you can still cling to serial with devices that emulate a serial port. In fact, you can just keep the serial port and use a cheap RS232 to USB cable (this is what I often do). The problem is, it looks — well — quaint to still have a serial port on your device.

FTDI is one of the best-known vendors of USB-to-serial hardware and it has a really interesting solution for this problem. It makes a series of DB9-USB modules that plug directly into the footprint for a DE9 connector (pedantic trivia: the B in DB25 refers to the size of the shell; there is no DB9 connector, even though everyone calls it that, but rather a DE9 connector). It makes them for male or female pin outs and with true RS232 output, 5V output, or 3.3V output.

If you use the true RS232 output version, you can leave your circuit board just as it is and now it will sport a mini-USB socket where it used to have the 9 pin serial connector. If you use the 5V or 3.3V devices, you will probably have to jumper over the blank space where you used to have a MAX232 or similar converter.

Although removing the RS232 converter will save a little money, these DB9-USB modules aren't cheap. They are about US$20 each in singles. On the other hand, it is a cheap way to spruce up a legacy design. I couldn't, however, find a handy way to draw 5V power from the device, so you can't easily USB power your board with these connectors.

If you don't mind them not looking like DE9 connectors, there are plenty of little USB to 5V serial port boards out there, often with Silicon Laboratory chips in them. I usually grab a few on eBay and just keep them around the lab. Not only are they very inexpensive, but I can usually get 5V and 3.3V from them off the USB connector to power small circuits. Not as cool looking as the DB9-USB, though.

I'll revisit this topic soon with a peek inside a practical USB project. How about you? Are you over RS232? How did you make the hop to USB? Or are you still holding on to those serial cables? Leave a comment with your experiences.

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.
 


Video