Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discussions

Reading SD Card on DE2-70

Altera_Forum
Honored Contributor II
3,398 Views

Hello, 

 

I am doing my thesis on image processing and I need to input an image and it seems that sd card is convenient way to input an image file. Has anybody achieved to read sd card ? I read many topic here but no solution has been provided. I use SpiMaster core from OpenCores but as I am new to FPGAs, the interface is a misery for me. If anyone could share a piece of code, that would solve a lot of questions for me 

 

Luya
0 Kudos
15 Replies
Altera_Forum
Honored Contributor II
1,604 Views

Using SPI should be easy i guess, mine is using SPI, and the read function works well. I used the SPI interface given in the DE2_SD_AUDIO project example by altera/terasic.

0 Kudos
Altera_Forum
Honored Contributor II
1,604 Views

It use NIOS I assume. I don't want to use it because I don't know how I am going to pass the sd-card data to vhdl side code. Also I didn't understand how to generate an sopc instance without CPU core.

0 Kudos
Altera_Forum
Honored Contributor II
1,604 Views

OK, I did it. It was really simple :rolleyes: 

Now I am trying to display the image on screen.
0 Kudos
Altera_Forum
Honored Contributor II
1,604 Views

Hi. I'am doing a similar project in pure verilog (in de2-115) and i want to read an image form sd card and show it to display. Can you give me some advise how to do it 

thank you
0 Kudos
Altera_Forum
Honored Contributor II
1,604 Views

 

--- Quote Start ---  

Hi. I'am doing a similar project in pure verilog (in de2-115) and i want to read an image form sd card and show it to display. Can you give me some advise how to do it 

thank you 

--- Quote End ---  

 

 

I gave up doing it but I remember I used this for reading content from sdcard and it worked: 

http://stevenmerrifield.com/tools/sd.vhd
0 Kudos
Altera_Forum
Honored Contributor II
1,604 Views

Thank you..

0 Kudos
Altera_Forum
Honored Contributor II
1,604 Views

 

--- Quote Start ---  

OK, I did it. It was really simple :rolleyes: 

Now I am trying to display the image on screen. 

--- Quote End ---  

 

 

Hi luya, I'm doing a similar project (SoC on DE2-70 FPGA board) which relates to reading an image from SD Card and display on screen. And I'm quite new in FPGA. Can you help me ? my email: nkmike1312@gmail.com. Can I have yours ?
0 Kudos
Altera_Forum
Honored Contributor II
1,604 Views

 

--- Quote Start ---  

Hi luya, I'm doing a similar project (SoC on DE2-70 FPGA board) which relates to reading an image from SD Card and display on screen. And I'm quite new in FPGA. Can you help me ? my email: nkmike1312@gmail.com. Can I have yours ? 

--- Quote End ---  

 

 

Hello Mike, I cannot help much, sorry. I explained above. But if you are also going to do image processing on FPGA, there were some nice projects for DE70 on internet. One of them did sobel edge detection in real time but from camera, not sdcard. That's all I can share with you. Good luck with your project. Luya
0 Kudos
Altera_Forum
Honored Contributor II
1,604 Views

Thanks for reply, luya 

In the code sd.vhd you shared above, I don't know the frequency of clock for SPI, so, I connect the clk that should be twice the SPI clock, to iCLK_50 of DE2-70 board. But the result is not the expected one (I let data out display on the red LEDR for monitoring). Can you explain more about how you make sure that code work ?  

Thank you very much :)
0 Kudos
Altera_Forum
Honored Contributor II
1,604 Views

Hello Mike, 

I hope someone will see your question and answer, but not me. I changed my project, just because I couldn't read the image file from SD Card.. 

Is it possible to simulate with modelsim and then debug, maybe?
0 Kudos
Altera_Forum
Honored Contributor II
1,604 Views

Hello redcode113 

 

The best frequency of clock for SPI is 25Mhz. There are some board that have SPI created and only you have control the controller.
0 Kudos
Altera_Forum
Honored Contributor II
1,604 Views

Thanks anthimos, 

 

Are you done your project in reading image from SD card ? If yes, can you give me some advises ?  

Thanks in advance 

 

P/S: I'm also in trouble with SDRAM controller - Wishbone bus interface. Any advises ?
0 Kudos
Altera_Forum
Honored Contributor II
1,604 Views

I didn't have many time to finish me project so i take a more easy way to sent data to RAM.. I did this with RS-232 it's the easiest way for my opinion and the way i like to control data.

0 Kudos
Altera_Forum
Honored Contributor II
1,604 Views

Hi redcode113 

 

I didn't have many time to finish me project so i take a more easy way to sent data to RAM. 

I did this with RS-232 it's the easiest way for my opinion and the way i like to control data.
0 Kudos
Altera_Forum
Honored Contributor II
1,604 Views

Thanks anthimos, 

Does it mean that you send data from computer to SDRam of DE2-70 through RS232 ? You implement this on STORM SoC ? Could you please give me your email ? Mine is: nkmike1312@gmail.com
0 Kudos
Reply