A weblog focused on interesting circuits, ideas, schematics and other information about microelectronics and microcontrollers.
Direct connecting: AVR to USB, no HW converters
Some techniques to connect AVR-based device to USB without a specialized HW, just only in the SW way.
If you want to connect your embedded device to USB, you've a few different ways to do it. At first, you can use special chips like FTDI. At second, you can choose a microcontroller with built-in USB interface. Or at third, you can use some SW solution. Every way has its own advantages and disadvantages.
Let's introduce the SW methods. SW methods are very simple (they needs minimum of external devices) and cheap. But they are limited on speed (only low-speed, 1.5Mbit/s) and advantages.
The first solution ever was (as far as I know) theby Igor Češko. His solution uses the AT90S2313 or AT90S2323, overclocked at 12MHz.
The second one is theby Dick Streefland. He's using the ATtiny2313 with 12MHz xtal.
The third one, IMHO the most complex solution, is theby Objective Development. It's open-source solution (GNU GPL), but a commercial license is available too. Some of the other advantages are:
- Fully USB 1.1 compliant low-speed device, except handling of communication errors and electrical specifications.
- Supports multiple endpoints: one control endpoint, two interrupt/bulk-in endpoints and up to 7 interrupt/bulk-out endpoints.
- 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 16.5 MHz internal RC oscillator.
- High level functionality is written in C.
- Only about 1200 to 1400 bytes code size.
So - if you plan to build some small USB-compatible device, why not try to use one of these solutions?