Atmel ARM Codes
Example AT91SAM7S-128 (64-256) USB Mass Storage Device (MSD) with SD or SDHC card
This example code implements an USB mass storage device on Atmel AT91SAM7-128 (or 64-256). Storage medium is an SD card connected via SPI interface.
The basic hardware example to run the code is show in the schematic which is included in the archive file. Of course some additional work is needed to implement the code in own projects,
especially code related to the power button needs to be changed for your requirements.
The code is well commented and there exist a Doxygen generated documentation.
All USB functions are based on Atmels USB MSD framework. But since the framework is increadible bloated and hard to understand, I reworked it completely and now it is
reduced to a minimum requirment to save resources and make the code more readable.
Transfer rates are not very fast, bottleneck here is the bulk endpoint size of only
64 byte in AT91SAM7 – 1.3MBits/s.
Code uses 23108 bytes program memory and 4312 bytes RAM.
Debugging output for all parts of the code can be configured in file trace.h
Debugging unit is used with parameters 115200 Baud 8N1.
Additional the code uses some peripheral features which may work as it’s own example as well, like:
- setup and use of interrupts with AIC
- setup and use of hardware timer for delays
- setup and use of UDP peripheral
- setup and use of SPI
- configurable printf function, from tiny up to floating point output
- setup of abort handlers
- FAT32 library
- SD card library with support for SDHC cards
- setup and use of debug unit, DBGU
- configurable trace library
This example code was successfully tested with Mandriva Linux, Windows XP SP2 and Windows Vista.


