Flash Card Reader

From Fpga4u

Jump to: navigation, search

Introduction

The Flash Card Reader is simply a physical card holder that connects the pins of the card to the FPGA. There is no additional hardware. The card reader can accept SD or MMC cards.

Connection (LCD PCB version C)

First, add a SPI controller to your design (call it mmc_spi if you want to use it from Linux). The parameters are

  • Master
  • 1 SS_n signal
  • SCLK: 25 MHz (works, at least from Linux, with a SD card)
  • Do not specify the delay
  • 8 bits data register, MSB first
  • Clock polarity: 1
  • Clock phase: 1

The Full TCL script now contains assignment for the SPI pins: MMC_SCLK, MMC_SS_n, MMC_MISO, MMC_MOSI.

On this PCB, the SPI bus is not shared.

Connection (old LCD PCB)

Since both SD and MMC cards have the possibility of being set to SPI mode, and since SPI is already used on the system for the LCD display, only an additional chip select signal was necessary to add the reader, as the other signals are shared with the LCD display.

SPI.png

To use the SPI bus, in SOPC Builder, simply add the SPI component and set it up according to the screen shot below:

Spi config.JPG

Remember to set as many SS_n signals as there are devices on the bus. If using both the LCD screen and the card reader, set it to 2. When assigning pins, remember which one is which. A speed of 1MHz works fine to read and write SD cards, but it seems that it may not work for MMC cards. It hasn't yet been tested at a lower speed for MMC cards.

Personal tools