Presentation is loading. Please wait.

Presentation is loading. Please wait.

PSoCR Secure Digital (SD) Card Module Solution

Similar presentations


Presentation on theme: "PSoCR Secure Digital (SD) Card Module Solution"— Presentation transcript:

1 PSoCR Secure Digital (SD) Card Module Solution

2 Agenda SD Card Basics SD Card Lab Types of Media Applications
Communication File System SD Card Lab Project 1: Run a short demo that prints the string “Hello World” to the SD Card Additional Example Projects

3 SD Card Basics

4 What is an SD Card? High-capacity, inexpensive, portable flash (non-volatile) memory Capacity: 32MB to 2GB Size: 11mm x 15mm x 1mm Designed for fast and easy transfer of data between devices Security for copyright protection on SD Cards

5 PSoC + SD: Supported Media
32mmx24mmx2.1mm 2GB - $100 / 256MB - $20 miniSD Great for small electronics 256MB - $35 microSD/TransFlash Smallest memory card available 256MB - $35 / 2GB - $120 MMC Up to 8GB 2GB - $50 RS-MMC/MMCmobile Popular for handsets MMCmobile: Meets lower voltage spec of 1.8V HCSD Capacity > 2GB SDIO Extends functionality of devices with SD Card socket Not Supported

6 Where is SD Used? Digital Cameras (DSC, Video) Media Players
Voice Recorders PDA PC Peripherals GPS – Data Tracking Mobile Handsets – Number and Setting Storage Exercise Equipment – Storing Data Bootloaders – Feed Data to Other Devices for Programming Shoes….

7 Where is SD Used? PSoC Supported
Digital Cameras (DSC, Video) Media Players Voice Recorders PDA PC Peripherals GPS – Data Tracking Mobile Handsets – Number and Setting Storage Exercise Equipment – Storing Data Bootloaders – Feed Data to Other Devices for Programming Shoes….

8 PSoC + SD: Required Resources
Digital Blocks Analog Blocks Flash RAM I/O 1 (DCB) 20kB 700 bytes 4-7 **Limited to only 29xxx family parts File System must be compatible with the build configuration (selectable parameter) of the User Module (UM) Several build configurations are available in the SDCard UM Complex file systems require more flash Must support additional addressing requirements Full – Additional addresses require more flash (How much on average?) Standard – Complete API list is loaded into library source file (How much do you save by using FAT16/Standard option?) Build Configuration Options: FAT32: Must use “Full File System” build configuration FAT16: Can use “Standard File System” or “Full File System” build configuration Basic Read Only Basic Read Write APIs removed from library source file  reduced flash usage No file system  reduced flash usage

9 Why is so much Flash required?
Implementing the file system to interface to SD Card requires sizeable Flash space Most cards are formatted with FAT32 (Generally 32MB and greater)- Full file system build configuration. **FAT32 is a more complex file system, and requires more flash to support additional addresses available in the card. The FAT32 file system has more address space which requires more flash than the FAT16 file system. Both these file systems include the same API functions. The other build configurations reduce the size of flash needed by offering SD Card communication options with more limited capabilities.

10 Some Definitions: “File System”
Data Structure that… Stores and organizes computer files and data Facilitates access to storage devices Contains directories with subsets of filenames Allows files to be searched, copied, renamed, removed, etc.

11 PSoC File System Compatibility
Compatible: MS-DOS - Microsoft FAT16 FAT32 NOT Compatible: MS-DOS FAT12 Limited availability Requires more code space than FAT16 3-bit nibbles HFS - Hierarchical File System Apple Computer – MAC OS NTFS – New Technology File System Windows NT Windows 2000 Windows XP

12 Some Definitions: “FAT”
FAT: Disk structure that partitions blocks of contiguous space into clusters Connects each file with an index into a file allocation table (FAT) Clusters are typically 2 KB to 32 KB in size Clusters contain groups of sectors which are 512 bytes in size Each cluster may only link to one file at a time Files typically contain many sectors or clusters FAT entries correspond one for one with clusters Each FAT entry points to the next FAT entry for the same file or directory A special value indicates the end of the file The size of FAT entries dictates the size of the FAT and the maximum size of the disk. There are 3 common FAT entry sizes in use: FAT Entry Size Number of Clusters FAT12 4,078 FAT16 65,518 FAT32 268,435,438

13 PSoC + SD: Nuances Limited by cache buffer size
Requires Short File Names (Dos8.3) Saves code space Generally longer file names are mapped to other directories which aren’t supported Supports Only 1 Directory: Root Directory More code is required to track directory paths Flat-file system Speed Reduced with Multiple Files Open More RAM needed for additional files Read/Write speed of ~2200 BYTES per second SPI mode instead of SD mode Clock speed Two clock speed choices: 24 MHz at 5V: 5% Performance Enhancement 12 MHz at 3.3V Limited by cache buffer size

14 PSoCSD Connections (2.7-3.3V)

15 PSoCSD Connections (5V)

16 SD Card Communication: 2 Types
SD Mode Clock 4 Bidirectional Data Lines SPI Mode (PSoC Supported) Card Select (Slave Select) 2 Unidirectional Data Lines

17 SD Internals PSoC implements the file system:
PSoC supplies a command to the card interface controller in order to read from or write to files on the SD card Card interface controller retrieves data PSoC completes calculations to determine further necessary commands

18 SD Card Lab

19 Lab Hardware: CY3210-SDCARD
SD Card Adapter board (3.3V) is compatible with the LCD connector on the CY3210-PSoCEVAL1 board (shown) To properly supply SD Card Adapter board with 3.3V Insert jumper JP3 to regulate voltage to 3.3V Remove the following jumpers: JP2: Connects P27 to TX pin JP1: Connects P16 to RX pin

20 Lab Hardware: SDUSB CY3210-SDCARD Kit also contains
SD Card Reader/Writer with USB connection 64 MB SD Card Connect Reader/Writer to PC and insert SD Card to read *Note: Additional projects located in PSoC Designer Examples directory

21 Lab Software: You Need to Install…
PSoC Designer PSoC Express PSoC Programmer Latest User Module (UM) Extension Pack

22 Project 1: “Hello World” Quick Example
Build Project Insert SD Card Adapter board into LCD connector on CY3210-PSoCEval1 board (as shown) Put CY8C PXI PSoC device into 28-pin PDIP socket Open “Hello World” project from PSoC Designer in the following directory: C:\ProgramFiles\CypressMicrosystems\ PSoCDesigner\Examples\SDCard\Hello Generate application, build and program part Connect 12V power supply to voltage regulator on PSoCEval1 board Run Project Insert SD Card into SD Card Adapter board’s socket PSoC writes “Hello World” to SD Card Remove SD Card Place SD Card in USB Thumb Drive Read “hello.txt” *Note: Using MiniProg to program will supply the entire PSoCEVAL1 board 5V. Remove SD Card from Adapter board before using MiniProg.

23 Additional Example Projects
The following example projects are located within PSoC Designer: C:\Program Files\Cypress MicroSystems\PSoC Designer\Examples\SDCard AppendFile - Open a file and write string to a file. Also print file’s size out the serial port. ListFiles - When card is inserted in the SD socket, the file’s names and their sizes will be printed via the serial port. SdCopyFile - Creates a file then copies it to another file. UartLog - This application requires the use of a terminal emulator. It will log data to the SD Card until a line with a period "." in the first character location is detected. UartRead - Open a specific file and display its contents via a serial port.

24 Resources SD Card Physical Layer Specification www.sdcard.org
MMC Card Physical Layer Specification


Download ppt "PSoCR Secure Digital (SD) Card Module Solution"

Similar presentations


Ads by Google