MMC/SDDevelopment Background ============================ The MMC/SD card development boards that I have are primarily designed for the development of low cost long-term, slow rate, data logging projects like weather stations. The idea is to make the stored data easy to recover by simply placing the card in a PC's card reader. The latest board is the SDMMX3 which is more compact but essentially the same as the MMSD3 board. The PIC code is written using MELab's PICBasicPro ver 2.44(www.melabs.com). The kits are designed for developers/hobbyists who would like to investigate incorporating MMC/SD technology in their own designs. They are not intended to be out-of-the-box 'plug'n'play' devices. It is assumed that the user is capable of programming microcontrollers and has the necessary programming tools and software to do so. SD/MMC cards save data in 512 byte locks the incoming data needs to be stored before it is written to the card. Since the PICs used do not have sufficient RAM to build large buffers an external eeprom is used. The shuffling of large blocks of data in and out of the eeprom to/from the card creates delays in I/O. This requires that the incoming data has to be controlled so that it can pause a few milliseconds between each packet of 512 bytes being sent. Demo firmware witten in PICBasicPro is provided to show how raw data can be read and written to the card. The demo firmware source code written in PICBasicPro provides the user a means of understanding how to incorporate the read/write procedures in their own application. Two methods of data recovery are possible. First, a Windows app written specifically to interface with the firmware in the microcontroller connected to the MMC/SD. This method has nothing to do with a file system and therefore is not visible to the Windows OS, data is simply stored and recovered from address locations, just like one would do with an eeprom. I have a Windows app (MMC I/O Ver 1.x) and PIC firmware to demonstrate that available at the Workbench site. Second, some sort of Windows FAT 'file system' firmware could be written so that the MMC/SD acts just like a removable drive when used with a card reader. My single-file FAT code gives one a method of doing that, but only for a single file. The code works with Win98 PC's (Windows FAT12/16 formatted cards) as well as Win2K/XP (Windows FAT16 formatted cards). The interface between the microcontroller (Microchip PIC or Atmel AVR) is in SPI mode only and not in MMC or SD mode. There is no security implementation using the SPI mode. Both the MMC and SD simply act as storage devices. Due to the limitations of 8-bit midrange microcontrollers with scarce RAM, 'streaming data' is not possible. The PIC code only updates the file size in the card's root directory and not the date and time or any other file attributes. Even though the MMC Organization and SDCard Organization have established MMC/SD standards, not all manufacturers abide by them. This is especially true for card readers. This can, at times, cause problems with card readers not working correctly with a certain brand of card. There are rare incidents when a card fails to initialize. The MMC development kit has been tested with SanDisk and IO-Data card readers with a variety of cards such as SanDisk, Viking, MaxTech, SimpleTech, Lexar and IO Data. There have been some isolated situatons when certain cards may fail to initialize. If one wants to implement secure storage, it would require interfacing the SD card by using a high speed controller with a ram buffer (beyond the capability of the mid-range PIC's). The SD Card Association does have fees and royalties associated with secure data implementation. You can find more info at http://www.sdcard.org/documents.htm For a nominal fee, the source code for a 'single file' system which works on FAT16 formatted cards is available. The latest PIC code will work with Win98SE/Win2K and WinXP for MMC/SD cards 16mb and over. If smaller sized cards (FAT12) are to be used then there is similar source code available but will only work with Win98SE. PLEASE NOTE: The firmware is by no means a complete DOS type file system. This would not be possible without a considerable amount of RAM to build large buffers. For Win98SE (FAT12/FAT16 formatted cards) PIC source: MMCSRC or MMSDSRC For Win98/Win2K/WinXP (FAT16 formatted cards) PIC source: SDMMXSRC Other than pin assignments changes for the different controller boards, the code is the same for SD and MMC. The code demonstrates writing to a card by writing a 16kb ASCII text file to the card which can be read in the PC's card reader. Each time the code is executed the file is appended with 16kb more of text. Bytes of data to be stored are sequentially assigned to a variable (E_BYTE) and then a subroutine (ESAVE) is called. Since the MMC/SD only writes in chunks of 512 bytes, the data is temporarily stored in the external eeprom. When 512 bytes have been accumulated the eeprom "buffer" is transferred to the MMC/SD card and the card's FAT and directory are updated at the same time. Since this transfer and updating consumes time, it makes it impossible to "stream" data to the MMC. The original premise of the code was to implement it in long term data logging projects where data was received at a slow I/O rate. Using the demo source code one can modify/create their own applications. The code is essentially the same for MMC and SD cards. The original code, MMCSRC, will work with Win98SE only, but can also handle the smaller sized cards (Less than 16mb FAT12 cards). The latest code SDMMXSRC, will work with Win98SE,Win2K and WinXP but only for FAT16 cards (16mb and over). Win2k/XP format cards quite differently than does Win98. There are a couple of different dev boards, hence there several versions of the PIC code. Regardless, the code is the same just that different PIC pins are used. PIC code is also provided that will format 16mb,32mb,64mb and 128mb and place an empty file on the card. The COMPSys Workbench is not a company per-se, rather it is a very small group of enginners/hobbyists who work in a variety of areas and tinker with micro projects in their spare time. The Workbench provides an area for experimenting. When a project seems worthy of providing assistance to other developers it is posted on the website and a limited amount of printed circuit boards/kits are made. All funds received are put back in to the development pool to covers costs of parts, tools, software, on-going projects, website etc. ... Ranjit Diol COMPSys 608 Green Street Dowagiac, MI 49047 http://www.compsys1.com/workbench/