AN282 Silicon Laboratories, AN282 Datasheet

no-image

AN282

Manufacturer Part Number
AN282
Description
Manufacturer
Silicon Laboratories
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AN282
Quantity:
5 510
Part Number:
AN282
Quantity:
5 510
Part Number:
AN2827PC
Manufacturer:
AMD
Quantity:
5 510
Part Number:
AN2827PC
Manufacturer:
API Delevan
Quantity:
5 510
1. Introduction
2. USB MSD Reference Design Hardware Overview
The MSD reference design hardware consists of two boards - C8051F340-TB Target Board and CF, SD, MMC
Memory Expansion Board (AB5). These are contained in the kits C8051F340DK and USB-MSD-RD, respectively.
See the USB-MSD-RD User's Guide for details on the contents of these kits. Figure 1 shows these two boards
connected via the expansion connector. Figure 2 shows a block diagram with the connections between the
hardware components. Refer to the USB-MSD-RD User's Guide for detailed pin connections, schematic, and bill of
materials of the evaluation board.
Rev. 0.1 5/06
U S B M
Among the USB device classes natively supported by popular operating systems, the USB Mass Storage Device
(MSD) class is one of the most widely supported device classes. A USB device that supports this class can use the
built-in drivers provided by the operating system, without the need to install or maintain any custom device drivers.
The USB MSD Reference Design utilizes this widespread support by providing device firmware for Silicon
Laboratories USB microcontrollers that complies with the MSD class specification. This USB MSD Reference
Design Programmer's Guide describes in detail the various components of the device firmware. The USB-MSD-RD
Reference Design Kit User's Guide includes demonstration instructions and information about the kit contents.
Relevant Devices
This application note applies to the following devices:
C8051F340, C8051F341, C8051F342, C8051F343, C8051F344, C8051F345, C8051F346, C8051F347
A S S
Figure 1. C8051F340-TB Target Board connected to AB5 Expansion Board
S
T O R A G E
D
Copyright © 2006 by Silicon Laboratories
E V I C E
R
E F E R E N C E
D
E S I G N
P
R O G R A M M E R
A N 2 8 2
'
S
AN282
G
U I D E

Related parts for AN282

AN282 Summary of contents

Page 1

... Refer to the USB-MSD-RD User's Guide for detailed pin connections, schematic, and bill of materials of the evaluation board. Figure 1. C8051F340-TB Target Board connected to AB5 Expansion Board Rev. 0.1 5/ Copyright © 2006 by Silicon Laboratories AN282 ...

Page 2

... AN282 Example Parallel Interface Figure 2. USB MSD RD Hardware Block Diagram 2 PC (For App) C8051F340-TB CompactFlash Memory Memory Card AB5 Memory Expansion Board Rev. 0.1 (For MSD) SPI SD / MMC Card ...

Page 3

... HyperTerminal Driver Stack RS232 Serial Port PC Temp. Sensor ADC UART Example Application File System Sector Server SPI Expansion Board Rev. 0.1 AN282 Example App. components that can be customized Example App. Data Flow RS232 Transceiver Push Buttons External HW Peripherals Compact Flash Memory Card SD / ...

Page 4

... AN282 Available Free Space (39.1 kB) 62% 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). ...

Page 5

... Write_Sector (unsigned long address, char* buffer) Parameters: 1. address-Starting address of the 512-byte block in the CF card. 2. buffer-Pointer to a memory location where the data will be copied from. Return Value the write operation was successful. CF_NO_CARD card was detected. Errorcode, otherwise. Rev. 0.1 AN282 5 ...

Page 6

... AN282 4.1.2. SD/MMC Interface Firmware The SD/MMC Interface Firmware is the low-level interface that allows the rest of the system to access Secure Digital (SD) and MultiMediaCard (MMC) memory cards. SD/MMC cards use SPI for communication in 4-wire mode. A SD/MMC card is connected to the 'F340 device port pins as described in Section “2. USB MSD Reference Design Hardware Overview” ...

Page 7

... Used for: Numbers Partition table Not used 0 Boot record st 1..243 1 FAT copy nd 244..486 2 FAT copy 487..518 Root directory 519..end File data Rev. 0.1 AN282 Number of Size Blocks 1 512 512 B 243 122 KB 243 122 62000+ 30 ...

Page 8

... AN282 Function Name Sect_Init Sect_Validate Sect_Sectors Sect_Print Sect_Read Sect_Write Sect_Write_Multi_Fat Sect_Root_Dir Sect_Root_Dir_Last Sect_File_Data Sect_Fat1 Sect_Fat2 4.3. USB Low-level Interface The USB descriptor is an important component of the USB low-level interface. When a USB device is plugged into a USB host, USB Enumeration is initiated, during which USB descriptors are requested by the host to determine the capabilities and requirements of the device. The information contained in the descriptor allows the host to load the appropriate device drivers and allocate power to the device, if requested. See " ...

Page 9

... CBWCB (contains SCSI command dCSWSignature (= 0x53425355) dCSWTag (=identical as dCBWTag) bCSWStatus (=Good, Fail or Phase Error) Rev. 0.1 AN282 bCBWLUN ...

Page 10

... AN282 4.4.3. Command Interpreter State Machine The command interpreter implements a simple state machine that is very similar to the Command/Data/Status Flow shown in Figure 5. In the state machine implementation, the 'Data - In' and 'Data - Out' stages in this figure have been combined into one state. Figure 5. MSD Class - Command/Data/Status Flow MSD_READY: The state machine is in this state most of the time ...

Page 11

... So, the best interval should be reevaluated if any modifications are made to those functions. Supported Devices: C8051F340/1/2/3/4/5/6/7 Module: F34x_MSD_MSD.c Prototype: void Msd_Step (void) Parameters: None. Return Value: None. Refer to Section “5. Mass Storage Device Mode Operation” for an illustration of how the MSD block communicates with the other firmware components. Rev. 0.1 AN282 11 ...

Page 12

... AN282 4.5. SCSI Command Interpreter Small Computer System Interface - 2 (SCSI- standard primarily used by hard disk drives and optical drives that defines an I/O bus for interconnecting computers and peripherals. The USB MSD class specification is written such that SCSI commands can be embedded inside the MSD class structures CBW and CSW. This allows Flash- based memory cards to be connected via USB and appear as disk drives within the operating system ...

Page 13

... Changes the current working directory. Supported Devices: C8051F340/1/2/3/4/5/6/7 Module: F34x_MSD_File_System.c Prototype: BYTE chngdir (char* dirname) Parameters: 1. dirname-Pointer to a memory location that contains the directory name. Return Value the directory does not exist the directory change was successful. Rev. 0.1 AN282 13 ...

Page 14

... AN282 4.6.4. mkdir Description: Creates a new directory. Supported Devices: C8051F340/1/2/3/4/5/6/7 Module: F34x_MSD_File_System.c Prototype: BYTE mkdir (char* dirname) Parameters: 1. dirname-Pointer to a memory location that contains the directory name. Return Value the directory was created successfully. DIRECTORY_EXISTS directory by the specified name already exists. ...

Page 15

... Supported Devices: C8051F340/1/2/3/4/5/6/7 Module: F34x_MSD_File_System.c Prototype: unsigned fwrite (FILE* f, BYTE* buffer, unsigned count) Parameters: 1. f-Pointer to file structure 2. buffer-Pointer to a memory location where the data will be copied from. 3. count-The number of bytes to write to the file. Return Value: Number of bytes written to the file. Rev. 0.1 AN282 15 ...

Page 16

... AN282 4.6.10. feof Description: Checks whether the specified file's current position pointer has reached the end of the file. Supported Devices: C8051F340/1/2/3/4/5/6/7 Module: F34x_MSD_File_System.c Prototype: int feof (FILE* f) Parameters: 1. f-Pointer to file structure Return Value the file's current position pointer has not reached the end of the file. ...

Page 17

... Figure 6. Mass Storage Device Mode Operation (Host to Device) USB CBW CSW Figure 7. Mass Storage Device Mode Operation (Device to Host) MSD SCSI SCSI Rx USB OUT SCSI Status SCSI Residue MSD SCSI SCSI Rx USB IN SCSI Status SCSI Residue Rev. 0.1 AN282 Sect-serv Sect Write Sect-serv Sect Read 17 ...

Page 18

... AN282 6. Embedded System Mode Operation When the device is in the Embedded System Mode, the following blocks are used. See Figure 3 for the connections between the blocks. App. Specific Hardware (RS232 Transceiver) On-chip hardware peripherals (Temp. sensor, ADC, and UART) Application Firmware ...

Page 19

... Universal Serial Bus Mass Storage Device Class Bulk-Only Transport, Revision 1.0, September 31, 1999 [3] SCSI Architecture Model - 3 (SAM-3), Revision 9, September 12, 2003 [4] SCSI Block Commands - 2 (SBC-2), Revision 10, September 13, 2003 [5] SCSI Primary Commands - 3 (SPC-3), Revision 17, January 28, 2004 [6] Multimedia Commands - 4 (MMC-4), Revision 2d, September 2, 2003 [7] CF+ and CompactFlash, Revision 3.0 [8] MMC System Specification, Revision 3.31 Rev. 0.1 AN282 19 ...

Page 20

... AN282 A A—MSD RD USB D PPENDIX The USB Descriptor used by the USB MSD RD is available in the module 'F34x_MSD_USB_Descriptor.c'. The descriptor has been written based on the information from the 'USB MSD Bulk-Only Transport' specification. The salient points about this descriptor are listed here: Device Descriptor The device descriptor field must have a unique serial number that is at least 12 digits ...

Page 21

... In the case of the USB MSD RD, three Windows built-in drivers are automatically loaded. They are listed here: Generic Volume SiLabs Mass Storage USB Device USB Mass Storage Device D ETAILS Table 6. Drivers Loaded by Windows Device Driver Stack Rev. 0.1 AN282 Driver File System disk.sys usbstor.sys 21 ...

Page 22

... AN282 C I ONTACT NFORMATION Silicon Laboratories Inc. 4635 Boston Lane Austin, TX 78735 Email: MCUinfo@silabs.com Internet: www.silabs.com The information in this document is believed to be accurate in all respects at the time of publication but is subject to change without notice. Silicon Laboratories assumes no responsibility for errors and omissions, and disclaims responsibility for any consequences resulting from the use of information included herein ...

Related keywords