2
\$\begingroup\$

I interfaced SD card (with SPI) with an C8051f931 successfully. Now my next task is to interface an SD card with FPGA. So basically the FPGA will issue commands to the SD card for reading etc. In case of controller I used C programming where to send any particular command I used to write in some register. Writing to those register will send the data to the sd card.

How do I proceed in the case of FPGA. How do send any SPI command using FPGA? A friend of mine said to send command you will have to write a FSM for this purpose.

Can somebody through more light on the exact procedure I have to follow. By the way I have some knowledge of VeriLog and I can pickup advance concepts easily.

Update

I got sequence of operations I have to perform to access SD card. This is very much clear to me. But for what I have to use FSM?

\$\endgroup\$
  • \$\begingroup\$ I thin you are missing the basic fundamentals of what an FPGA is. FPGA is not a micro controller, it does not have (in most cases) any kind of interface, but it has logic that can make almost anything. If you want to create an interface for an SD card, you must first have a SDIO controller, second, on top of that, you need to have a CPU or a State machine to send and receive commands/data. That is where the FSM is used! \$\endgroup\$ – FarhadA Sep 9 '13 at 11:20
3
\$\begingroup\$

Take a look at this example which uses a Xilinx FPGA. It instantiates a block which provides a SRAM like interface to the rest of your HDL logic. The actual code seems to be here (the blog is somewhat out of date)

Note that it uses the SD Card directly (as a large SPI flash, basically), without regards to any file-system. An implementation which accesses FAT(32) formatted cards will probably require an external micro-controller or soft-core processor.

\$\endgroup\$
  • 1
    \$\begingroup\$ Indeed I do not have a file system. Also this FPGA is having a SD card controller. Is this prefabricated or somebody has to design it \$\endgroup\$ – gpuguy Sep 3 '13 at 8:39
  • 1
    \$\begingroup\$ I'm not sure what you are asking...this is a SD card controller written in VHDL and synthesized using programmable logic. \$\endgroup\$ – Zuofu Sep 3 '13 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.