SIAM32 USB

Software Implemented Atmel Mega32 Universal Serial Bus Host Controller


Flying pig!

Introduction

Documentation

Introduction

This software implements a Low Speed (1.5 Mbps) USB 2.0–compliant Host Controller on the Atmel Mega32 microcontroller.

This project has yielded a library that can be included from any program written for the Mega32. Using this library, a user can implement USB functionality within their application. The library has a high level asynchronous I/O interface with transparent layering that also allows library users to perform low-level operations on the bus.

Documentation supplied by the USB Implementer's Forum and various summary articles allowed for the development and implementation of the USB protocol stack for the Atmel Mega32.


Abstract

The prominence of microcontroller-based embedded design and a steadily increasing base of USB peripherals provided the impetus for this project. Previous implementations of USB software solutions have been successfully implemented on more powerful microcontrollers[1], and it was hypothesized that a scaled down version of such an implementation would be possible using Atmel's 8-bit ISA. A fully functional Low Speed (1.5 Mbps) USB Host Controller was created for the Atmel Mega32 using an ANSI C99 code base using with a processor option for optimized Atmel 8-bit assembly. From this code base, USB communication was established, and an API was created for peripheral utilization. These results demonstrate the propensity for a Low Speed device's use in the 8-bit AVR programming environment. This project was also notably successful in achieving goals of hardware simplicity, unobtrusiveness when used as a software library, complete originality of code, and production of solely open source software.

1. Jungo Software extended its USB software stack implementation to include Atmel's ARM7 and ARM9 microcontrollers, which use a 32-bit ISA. This implementation runs at Full Speed (12 Mbps).


About Us

This project was started as an ECE476 final project in Cornell's College of Engineering by Ben Hutton, Chris Leary and Devrin Talen. Chris and Devrin undertook an independent study (ECE491) in which the code library, hardware schema, and documentation were vastly improved.


FAQ


Pictures

Below are some pictures taken during various stages of the project.

logic analyzer logic analyzer
work bench circuit board
circuit board circuit board
logic analyzer

Reference

  1. USB 2.0 Specification. April 27, 2000.
  2. Open Host Controller Interface Specification. October, 1996.
  3. USB Made Simple
  4. USB in a Nutshell, http://www.beyondlogic.org/
  5. Cyclic Redundancy Checks in USB
  6. USB Human Interface Device Specification
  7. GNU Make Manual
  8. IEEE Micro - Tutorial on CRC Computations
  9. AVR Libc Online Manual

License & IP

GNU Public License

This code is released under the GNU Public License.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

IP Considerations

All of our code is original. Our CRC5 algorithm was inspired by Ron Hemphill's CRC5 code and our CRC16 algorithm was greatly assisted by instructions in a USB.org CRC whitepaper.

The USB2.0 Specification is provided at http://www.usb.org/developers/docs/ with the following disclaimer:

LEGAL DISCLAIMER

THIS SPECIFICATION IS PROVIDED "AS IS" AND WITHOUT ANY WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED. WITHOUT LIMITATION, THERE IS NO WARRANTY OF NON-INFRINGEMENT, NO WARRANTY OF MERCHANTABILITY, AND NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. ALL WARRANTIES ARE EXPRESSLY DISCLAIMED.

USER ASSUMES THE FULL RISK OF USING THIS SPECIFICATION. IN NO EVENT SHALL USB-IF BE LIABLE FOR ANY ACTUAL, DIRECT, INDIRECT, PUNITIVE, OR CONSEQUENTIAL DAMAGES ARISING FROM SUCH USE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

An adopter's agreement is available at http://www.usb.org/developers/docs/adopters.pdf, used to enter into a crosslicensing agreement with other USB implementers. We did NOT fill out this agreement.

Legal Considerations

We are not using any code or specification that requires licensing. For us to legally use the USB logo on any of our material, we would need to either pay a $2000 fee or join the USB Implementers Forum. We haven't, so we aren't using the logo.

We are licensing our code under the GPL (see License section). You may feel free to use it, modify it, and distribute it, according to the terms and conditions of the license.

Download

Release: siam32-0.2a.tar.bz2 [80K]

Docs: siam32-0.2a.pdf [376K]

Latest build: SIAM32 [launchpad]

Old website: download [1.3M]

Contact

Got bug patches? Questions? We try our best to answer email, but the FAQ is your best bet for quick answers.

Christopher D. Leary

Devrin Talen