Mmc / Sd Memory Card Fat16 / Fat32 Driver Technical
Total Page:16
File Type:pdf, Size:1020Kb
MMC / SD MEMORY CARD FAT16 / FAT32 DRIVER TECHNICAL MANUAL V1.06 INDEX Index ........................................................................................................................................................................ 2 Driver Overview .......................................................................................................................................................... 4 Features .................................................................................................................................................................. 4 Driver Technical Notes ............................................................................................................................................ 5 Adding The Driver To Your Project ............................................................................................................................. 6 Notes About Our Source Code Files ....................................................................................................................... 6 How We Organise Our Project Files ................................................................................................................... 6 Modifying Our Project Files ................................................................................................................................. 6 Step By Step Instructions ........................................................................................................................................ 6 Move The Main Driver Files To Your Project Directory ....................................................................................... 6 Move The Generic Global Defines File To You Project Directory ....................................................................... 7 Check Driver Definitions ...................................................................................................................................... 7 Timers .................................................................................................................................................................. 7 SPI Port Setup ..................................................................................................................................................... 7 Application Requirements .................................................................................................................................... 7 Important Hardware Design Notes .......................................................................................................................... 7 Using The Sample Projects ........................................................................................................................................ 8 Sample Projects Included ....................................................................................................................................... 8 Rowley CrossWorks Compiler for ARM .............................................................................................................. 8 Microchip C18 Compiler ...................................................................................................................................... 8 Microchip C30 Compiler ...................................................................................................................................... 8 Sample Project Functions ....................................................................................................................................... 8 Using The Driver In Your Project ................................................................................................................................ 9 Checking If A MMC or SD Card Is Available ....................................................................................................... 9 MMC / SD Card Operations ................................................................................................................................. 9 Characters That May Be Used In DOS Compatible File Names ....................................................................... 10 Partitions ............................................................................................................................................................ 10 Working With Multiple Files ............................................................................................................................... 10 Ensure Data Is Saved For Write Operations ..................................................................................................... 10 Reading & Writing A Text File ........................................................................................................................... 11 Reading & Writing A Spreadsheet File .............................................................................................................. 11 Fast Reading Of Bulk File Data ......................................................................................................................... 11 Fast Writing Of Bulk File Data ........................................................................................................................... 12 Using MMC or SD Cards For Firmware Updates .............................................................................................. 12 Deleting Files ..................................................................................................................................................... 12 Searching In The Directory ................................................................................................................................ 12 Disk Viewing & Editing Utilities ..............................................................................................................................13 Information ................................................................................................................................................................ 14 MMC / SD Memory Cards & FAT Filing System ................................................................................................... 14 MMC, SD And FAT Licensing ............................................................................................................................... 15 Specifications ........................................................................................................................................................ 15 Card Capacities ................................................................................................................................................. 15 Card Voltages .................................................................................................................................................... 16 Reduced Size Cards .......................................................................................................................................... 16 Formatting.......................................................................................................................................................... 16 Sub Directories .................................................................................................................................................. 16 Long Filenames ................................................................................................................................................. 16 Using The Driver With a RTOS or Kernel .......................................................................................................... 16 Code and Data Memory Requirements ................................................................................................................ 16 C18 Compiler Code & Data Size ....................................................................................................................... 16 C30 Compiler Code & Data Size ....................................................................................................................... 16 MMC / SD Card Mode ....................................................................................................................................... 17 MMC & SD Memory Card Specifications .............................................................................................................. 17 How The Driver Works .............................................................................................................................................. 18 The Driver Functions & Defines ............................................................................................................................ 18 Pin Defines ........................................................................................................................................................ 18 SPI Bus Defines ................................................................................................................................................ 18 Page 2 512 Byte Buffer Define ...................................................................................................................................... 18 Watchdog Timer Define ..................................................................................................................................... 18 User Options .....................................................................................................................................................