CURRENT ISSUE

Contests

bottom corner

Feature Article



Issue #209 December 2007

SD Card Display Controller
Honorable Mention Luminary Micro DesignStellaris2006 contest
by Sylvain Davaine

Start | System Overview | SD Memory Cards | Hardware | SHT11 Sensor | FAT File System | Graphic Files | Library | Host | Ideas | Sources & PDF

SD MEMORY CARDS

SDMCs can be operated using a standard SPI. With the Luminary Micro LM3S811, I used the synchronous serial interface (SSI) configured in SPI mode 0, with 8 bits of data, and a 12.5-MHz clock. Using a SPI to access SDMCs is a clever idea from the SDMC association. Unlike the SD protocol, SPI mode is free of charge and widespread in the microcontroller world. Moreover, SPI mode is a subset of the SD mode; therefore, it is easier to understand. Most older MultiMediaCards support the same SPI mode. I used my mobile phone’s RS-MMC in SPI mode during my tests with success.

The low-level functions of the SDMC are part of the ChaN FAT file system with small changes for the LM3S811. They are located in the mmc.c file. They consist of the SPI send/receive functions and SDMC initialize/read/write functions. Another function is regularly called by the LM3S811’s Timer0 to check for changes in the SDMC insertion state. It also checks for timeouts in the initialization process of the card if the card doesn’t respond.

The SDMCs, and consequently the R/W functions, work with 512-byte buffers. This makes writing the FAT file system easier because 512 bytes is also the native size of hard disk buffers.


Previous | Next

 


bottom corner