com/print/51771
BLOG Microcontrollers
1. Smart Media: It was a pure NAND card developed by Samsung/Toshiba, today it has
phased out since it is too large for today's devices.
2. Compact Flash: It is an industry standard flash card, very old, but still widely used in
many applications. The CF cards can be considered as hard disks via IDE/PCMCIA
interfaces.
3. Multimedia Card: A flash card developed by Infineon/Siemens/Sandisk, it can be
licensed from MMCA under NDA. It has a mini version called RS-MMC.
4. Memory Stick: A flash card family developed by SONY, designers can only get
specification from SONY under NDA. Sandisk is the major second source for memory
stick.
5. XD card: Actually it is an alternative package for NAND flash memory chip. We can
simply consider it as miniature SM card, which was developed by Fuji film and Olympus.
But it is seldom used in the embedded systems.
6. SD card: A flash card by Matsushita/Toshiba/Sandisk, it can be licensed from SDCA
under NDA. It has two mini version called mini-SD and micro-SD.
7. Trans-flash card: It is developed by Motorola/Sandisk for mobile phone. It was renamed
as micro-SD card.
We can easily found that Sandisk plays an important role in the flash card industry. The SD
card family is the market leader, since most of the cards offer SD adapters. So it is important
to support SD card in an embedded system. The SD card simplified specification is freely
available from the SDCA official site, but the detail specification is only available under NDA
and strict agreements. In order to support SD card in the devices, most of the suppliers have
to use proprietary SD card protocols in the designs. For example, Sharp used a proprietary
protocol in its Linux Zaurus PDA. There is a good article regarding this topic. Please check
reference for your information.
Actually Sandisk released the P-TAG, which is a flash card dedicated for health record of US
army. I have checked the specification. It is almost a SD card specification. The PDF file is
removed from Sandisk site now. Maybe Sandisk realized this file revealed too much
confidential information to the world.
Now Linux starts to integrate SD support in the latest kernel. Please check cited mail from the
Linux kernel maintainer. That means SD protocol is a standard feature of Linux kernel. It is
very exciting news for the embedded system developers. Compare to other interfaces,
including USB and Bluetooth, SD or SDIO card is relatively easy to deploy in the systems
from the technical point of view. The costs of BOM and development effort for SDIO cards
are also much lower. The reason is simple, SD and SDIO support SPI mode operation. And
SPI mode is available in many low-end microcontrollers, even emulated by firmware inside
the microcontrollers. And there is no requirement of running a complex stack in the SDIO
card as well. The microcontroller inside the SDIO card can easily map its IO or registers to
host controller, and let host controller to manipulate them. It is easy, but we still need extra
programming for switching SD card to SPI mode.
Micrium’s uC/OS-II open source RTOS kernel has a complementary embedded file system
called uC/FS. It is a file system for embedded applications which can be used on any media,
for which you can provide basic hardware access functions. µC/FS is a high performance
library that has been optimized for minimum memory consumption in RAM and ROM, high
speed and versatility. It is written in ANSI C and can be used on any CPU. An optional device
driver for MultiMedia & SD cards using SPI mode or card mode that can be easily integrated.
It is a good starting point to integrated SDIO support into your embedded system. I got a
fragment of the whole uC/FS source code from an evaluation board supplier, which only
offers SmartMedia card driver. If I have sufficient time, maybe I can port a SPI mode driver
and access the SD card. But I do not know the latest license term of Micrium. The developer
must contact the supplier first.
After the initialization procedure, the following communication in SPI mode, such as register
access, normal communication is quite easy. And CRC calculation is not required in SPI
mode by default, unless the system enable it explicitly.
I do have an unfinished reference code designed for Cypress PSoC. Maybe I should spend
some effort to finish it and sell it some day.
More Issues
SPI mode is convenient, but SD mode offers much higher communication speed. In case you
want a high speed communication on SD socket, the designer must sign the NDA with SDCA
for full specification and implement a dedicate SD card controller.
Reference
[1]
[2]
[3]
[4]
[5]
[6]
Trademarks
Links:
[1] http://www.sdcard.org/about/sdio/sdio_spec/
[2] http://www.linux.com/articles/20060
[3] http://www.linuxdevices.com/articles/AT6640645071.html
[4] http://www.micrium.com/products/fs/filesystem.html
[5] http://kerneltrap.org/mailarchive/linux-kernel/2007/9/24/273136
[6] http://findarticles.com/p/articles/mi_m0EIN/is_2001_April_19/ai_73388143