Mechanically MMC and SD cards are very small, with smaller compatible variants also available. They are low power and may be used with +3V3 systems. They use a serial interface based on the SPI specifications with fast transfer speeds possible (0-20MHz max clock rate for MMC, 0-25MHz max clock rate for SD) using only 4 pins. Data reliability is also provided by built-in defect management and error correction technologies. Whilst MMC and SD cards may also be communicated with using a 4 bit data interface this protocol is protected and not available without significant licence payments. The MMC card SPI interface protocol is available without any licence fee payable and is therefore more widely used than the 4 bit significantly more complex (and expensive!) protocol. SD cards are backwards compatible with the MMC card SPI interface and therefore this is typically the interface of choice for SD cards also. Note that the ‘Secure’ of Secure Digital, whilst available to licensed developers, is not widely used and you can just think of SD cards as a standard memory card in the same way as MMC cards (you do not need to implement security functionality to use them).
At the simplest level a MMC or SD card is just a large memory array which may be used in a similar way to a standard flash memory IC. Very simple applications may just use a MMC or SD card like any other memory device, storing data on it as required by the application. However this has the obvious limitation that the contents of the card is only readable and writable by the device that is using it. To allow other devices to easily read and write data to the card requires the use of a standardised file system. If a filing system is chosen that is also used by computers then sharing data with computer applications is made very simple.
There are 3 flavours of FAT (File Allocation Table):- FAT12, FAT16 and FAT32. FAT12 has now effectively become obsolete as the very small memory sizes of card this was useful for (<=16MB) are no longer generally available. This leaves FAT16 and FAT32. The 16 and 32 simply refer to the size of the cluster value in bits, although FAT32 is actually only 28 bits as 4 bits are reserved (see below for an explanation of clusters etc). This simply means that a FAT32 table takes up more space on a disk (or memory card), as each entry uses more bytes, but it allows addressing of larger memory sizes with smaller cluster sizes, resulting in less wastage of disk space. This use of smaller cluster sizes can quickly pay off in terms of efficiency as less space wastage at the end of each file frees up more space than the larger FAT32 table uses up.
Limits of FAT16
Maximum volume size is 2GB
Maximum file size is 2GB
Maximum number of files is 65,517
Maximum of 512 files or folders per folder
Limits of FAT32
Maximum volume size is 2TB
Maximum file size is 4GB
Maximum number of files is 268,435,437
Maximum of 65,534 files or folders per folder
You may think that you don’t need anything more than FAT16 for your application if you don’t plan to store more than 2GB of data on a MMC or SD card. After all, many embedded applications only need to store relatively small amounts of data. However MMC and SD cards with capacities greater than 256MB are typically supplied pre-formatted with FAT32. This is because FAT32 uses larger volumes more efficiently than FAT16 and is also less susceptible to a single point of failure due to the use of a backup copy of critical data structures in the boot record. Therefore if you use a driver that only supports FAT16 for your application your users will need to find a PC with a MMC or SD card adaptor to re-format larger capacity cards to be FAT16 before they can be used with your device. You also run the risk of increased technical support demands from users who haven’t read your instructions or don’t understand how to format a card as FAT16 instead of the default FAT32 and can’t work out why their new MMC or SD card won’t work in your device. Using a driver that supports FAT16 and FAT32 doesn’t result in a large amount of additional code space by today’s standards, as the two systems are very similar, and it makes life a lot easier for you and your users.
See the ‘Layout of a MMC or SD Card With FAT’ section later in this manual for detailed information of the FAT16 and FAT32 filing system.


