To USB, or not to USB?
Universal Serial Bus (USB) was a revolution for device communication, and has long become the standard of choice for connecting devices to desktop, mobile and embedded computing platforms. It has made adding new devices to a system simple and reliable, whilst also driving innovation in what devices can be developed. Brilliant!
USB has been so successful that using it for connectivity is no longer a feature, but a requirement. So why do so many embedded devices continue to be developed like it is the 90's?!
As anyone who has looked at a laptop recently will realise, serial ports don't feature. And as much as we love USB-RS232 converter leads (and the blue screens of death that tend to come with them), they really shouldn't be an acceptable solution!
Worse than this, they fail to unlock all the performance and flexibility that USB has to offer, which includes it being one of the greatest universal power connector standards on earth.
Making the move to USB
One of the reasons USB often doesn't make it in to the design spec is that it is naturally a more complex standard than a serial or parallel port, and simplicity often wins. But as we've already considered, that simplicity comes as a result of conjuring a false reality of the world it is going in to!
So what are the options for developing a USB device?
The two main ways to add USB to a design are:
- A USB Bridge IC
- A microcontroller with built-in USB
Of these two, the simplest approach is adding a USB bridge IC to your design. These tend to be a fixed-function USB to UART bridge, providing a USB virtual serial port that connects to a UART of a microcontroller. The implementation is simply adding some hardware, with the disadvantage being limited flexibility in USB functionality, and the cost of a two-chip solution.
The microcontroller with built-in USB interface is attractive because it is a single-chip solution (lower cost and board space), and provides lots of flexibility in the type of USB device that can be implemented. The downside is added firmware complexity to cope with; USB is not trivial to implement, and on constrained microcontrollers often has integrated at a fairly low level, so could easily be a step change in software complexity and risk for building a given device.
Upcoming changes in the trade-offs
The trade-off has generally been if you need simplicity, go for the bridge and accept the cost and flexibility downsides. If you need flexibility or low cost, go for the MCU and deal with the overhead and complexity of implementing it.
However, this equation is changing; the entrance of new ultra-low-cost 32-bit microcontrollers with USB.
These new devices are the same cost or less than the 8/16-bit microcontrollers that have dominated this space, but with all the advantages 32-bit brings in terms of performance and productivity. The trade-off starts to look something like:
As these low cost modern 32-bit microcontrollers emerge, it means you can end up having it all; a single-chip solutions, flexibility in your device, great headroom and simplicity through being able to apply software abstraction, and all at a price point to match or beat 8/16-bit! What is not to love?!
Btw, if you want to understand more about the advantages, there is some good information on the Cortex-M pages on the ARM website about moving from 8/16-bit microcontrollers which is worth a read.
Plug 'n' Play Prototyping for USB Devices!
We discovered a good example of these upcoming devices early last year when we were in discussions with NXP, and found out about their development of what became the NXP LPC11Uxx range of ARM Cortex-M0 based microcontrollers. When we heard the spec and price point for these devices, we realised the opportunities for applying them were huge, which is why we thought it'd be a great candidate for an mbed Microcontroller!
So for our second mbed Microcontroller design, we've taken the newest NXP Cortex-M0 in the range, the LPC11U24, an built a platform designed to make prototyping low-cost USB devices a snap, and let you concentrate on inventing the applications.
The new mbed NXP LPC11U24 Microcontroller board is packaged in the same DIP form-factor to gives access to the NXP LPC11U24 MCU, and includes I2C, SPI, UART and ADC interfaces. This provides easy access to prototyping with a powerful MCU that can form the foundation of future USB device implementations.
mbed NXP LPC11U24 Microcontroller:
We've implemented a complete set of open-source USB libraries including USB Mouse, Keyboard, HID, Serial, MIDI, MSC and Audio classes that make reliably creating a new USB device a matter of a few lines of code. Hopefully this will get you up and running in no time at all!
Open-source USB Device libraries:
Also, look out for a new demo we built for embedded world :) No one has quite guessed it yet:
mbed NXP LPC11U24 now in full production!
The mbed NXP LPC11U24 is now in full production and available in distributors with an RRP of $45 (including access to the tools, libraries and developer website).
If you have been thinking about building something with USB, or have always put it off until "next time", why not order a few to experiment with!
You need to log in to post a discussion