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

HARDWARE

The Luminary Micro LM3S811 evaluation kit is sandwhiched with the project’s PCB where only the fake SDMC connector on the latter projects beyond the outline of the former (see Photo 1). During my tests, I used another microcontroller to simulate a host connected to the PCB. I had problems with the physical dimensions of the fake SDMC in the prototype (if the notches are not well positioned, they will not insert correctly in the connectors and bad electrical connections will occur). That caused disconnections when plugged into my tablet PC and all of the other push-pull type connectors. I knew the routing of the signals was correct because I could see the contents of my card when it was plugged into an SDMC card reader. But I used my hand to keep the PCB pushed into the SDMC connector of the reader. To simplify the development process, the host microcontroller’s SPI link was soldered directly to the PCB and the LM3S811 evaluation kit connections. The software file system was also checked this way. The host was reading a text file updated by the LM3S811 whenever the chip select (CS) line of the SPI link was released. The file’s content was a numerical counter displayed on the host with an LCD. While doing this I was working in ideal conditions. When I tried to connect the entire system into a card reader again, it failed. First, I realized that I couldn’t drive the host lines because the host was driving them continuously and I had nothing on the prototype to isolate them with. Consequently, the hardware needed to be updated and I had tried to use 74HC573 buffers in series with the host line in the first place. The LM3S811 SPI lines were high-Z inputs when the software enabled the host lines via the output enable of the 74HC573. When an update had to be made on the SDMC text file, the outputs of the ’573 were disabled and the LM3S811’s SSI pins were enabled again. But this solution did not work either. Without an oscilloscope, debugging is quite difficult. But I measured a 20-MHz clock frequency from the host and remarked that the host was never driving the CS line low. The LED was connected to it to show that the card accesses were always off. That means that the ’573 was probably not able to transmit the signals at such a high rate (well, at least not without delays). The second observation was that the host was probably not accessing the card in SPI mode but in SD mode (which was later confirmed with the dismantling of my SMSC USB2223 USB card reader and with the names of the SDMC’s signals on the card reader chip’s datasheet). To thwart this, I changed the software to force it to initialize each time the SDMC was in SPI mode and added 5-V Panasonic RK1 high-frequency relays and ULN2803A Darlington drivers (see Figure 1). By default, the host is connected to the SDMC. When the software needs to write data, the relays are driven for a few moments, which connects the SDMC to the LM3S811 SSI. The SSI lines do not need to be switched off in high-Z, but some delays are required to avoid the glitches caused by the relays.

Figure 1
Figure 1—This schematic is straightforward. It connects an SD card to an LM3S811 microcontroller or to a fake SD card. The fake SD card is connected to a host that reads the files created with the microcontroller. The files created are BMP files visualizing the temperature in the form of a thermometer.


All components are 3.3 V. The circuit is powered by the Luminary Micro evaluation board via the USB interface and the 3.3-V serial regulator or by stealing power directly from the SDMC host interface (see Photo 2). With the JP1 jumper, you can also use external rechargeable batteries. The battery supply is connected to an ADC input port on the microcontroller for a future monitoring function of the power supply.

Photo 1
Photo 2—The circuit is connected to a pocket PC. The power is taken directly from the SDMC supply of the pocket PC.

Previous | Next

 


bottom corner