V-USB is a software-only implementation of a low-speed USB device for Atmel’s AVR® microcontrollers, making it possible to build USB hardware with almost any AVR® microcontroller, not requiring any additional chip.
V-USB can be licensed freely under the GNU General Public License or alternatively under a commercial license.
A comprehensive set of example projects demonstrates the wide range of possible applications.
- Fully USB 1.1 compliant low-speed device, except handling of communication errors and electrical specifications.
- Example projects demonstrate device and host driver implementations on Linux, Mac OS X and Windows.
- Supports multiple endpoints: one control endpoint, two interrupt/bulk-in endpoints and up to 7 interrupt/bulk-out endpoints. (Note that the USB specification forbids bulk endpoints for low speed devices, but V-USB supports them to some degree.)
- Transfer sizes up to 254 bytes by default, more as configuration option.
- Comes with freely usable USB identifiers (Vendor-ID and Product-ID pairs).
- Runs on any AVR microcontroller with at least 2 kB of Flash memory, 128 bytes RAM and a clock rate of at least 12 MHz.
- No UART, timer, input capture unit or other special hardware is required (except one edge triggered interrupt).
- Can be clocked with 12 MHz, 15 MHz, 16 MHz or 20 MHz crystal or from a 12.8 MHz or 16.5 MHz internal RC oscillator.
- High level functionality is written in C and is well commented.
- Only about 1150 to 1400 bytes code size.
- You can choose the License: Open Source or commercial. Click here for details.
For a comparison to other USB solutions for microcontrollers please click here.
This diagram shows a typical circuit for a bus powered device (click the image to enlarge).
D1 and D2 are a low cost replacement for a low drop 3.3 V regulator chip, such as the LE33. Operating the AVR at higher voltages exceeds the common mode range of many USB chips. If you need to run the AVR at 5 V, add 3.6 V zener diodes at D+ and D- to limit the voltage.
For a prototyping board, please see metaboard.
- Download the V-USB package containing a short description and several simple code examples.
- V-USB's git repository is on github.com.
- V-USB Wiki is a public Wiki with lots of additional information.
- There is also an excellent step by step tutorial by Code and Life.
- Another third party tutorial can be found at workinprogress.ca.