English
Language : 

AN282 Datasheet, PDF (4/22 Pages) Silicon Laboratories – USB MASS STORAGE DEVICE REFERENCE DESIGN PROGRAMMERS GUIDE
AN282
Available
Free Space
(39.1 kB)
62%
File System
(5.9 kB)
9%
Used
(23.9 kB)
38%
Example
Application
(5.1 kB)
8%
Compiler
Libraries /
Misc
(5.1 kB)
8%
USB / MSD /
SCSI (3.9 kB)
6%
Sector Server
(1.1 kB)
2%
SD / MMC
Media Access
(2.1 kB)
3%
CF Media
Access
(0.7 kB)
1%
Figure 4. USB MSD Firmware Code Space Usage on the C8051F340
The firmware is designed such that the reference design can be used in one of two ways:
Mass Storage Device Mode (connected to the PC via USB)
Independent Embedded System Mode (connected to the PC via RS232 serial interface).
In MSD Mode, the device appears as a USB Mass Storage Device on the PC. This mode uses the firmware
components 'USB', 'Mass Storage Device', 'SCSI', 'Sector Server', and 'Media Access'. In Embedded System
Mode, the example application can accept commands via a UART command interpreter shell, and perform
appropriate functions. In this mode, a RS232 serial connection is made between the 'F340 target board and the
PC. This mode uses an external RS232 transceiver, some on-chip hardware peripherals (Temp. sensor, ADC,
UART), and the firmware components 'Example Application', 'File System', 'Sector Server', and 'Media Access'.
Each component is explained in detail in the following sections. The USB-MSD-RD User's Guide contains step-by-
step instructions that demonstrate both the modes of operation.
4. USB MSD RD Firmware Components
4.1. USB MSD RD Media Access Firmware
The USB MSD RD includes firmware to access SD/MMC and CompactFlash cards. In a typical application where
only one type of interface is needed, the unnecessary media access firmware can be removed to save code space.
Also, some parts of this media access firmware might need to be modified to fit the end application. For example,
the pins that are assigned to the SPI peripheral might need to be changed to accomodate other system
requirements.
4.1.1. CompactFlash Interface Firmware
The CompactFlash (CF) Interface Firmware is the low-level interface that allows the rest of the system to access a
CF memory card. The CF card is accessed by the firmware using a parallel interface that consists of an 8-bit data
bus, a 3-bit address bus, and 6 control signals. A CF card is connected to the 'F340 device port pins as described
in Section “2. USB MSD Reference Design Hardware Overview”. After a device reset, the Init_CF function is called
by the Sector Server. If this detects a card, then a call to Identify_Drive is made to get the size information of the
card. The Read_Sector and Write_Sector functions are then used for data transfers.
The CompactFlash media access functions are described below. There is typically no need to call any of these
functions directly from the Application-level firmware because the Sector Server layer encapsulates them. When
designing new hardware, these functions may need to be modified to suit the new hardware connections.
4
Rev. 0.1