Forum Discussion
Writing .txt file in SD Card - DE2
Hello, I am Student from a University beginner in FPGAs, and I was doing a project with Nios II that uses a Altera DE2 Board to do some operations and save the results. The main ideia was to transmit to computer the results, but the USB take too much time to the FPGA.
Now I am seaching a way to save those results at the SD card. But I couldn't find a way to store data in SD card. My idea was to create a .txt file that could receive at the end of each operation a value in the next line. If someone knows how save values in the SD card, I really appreciate your help, if you help send me.37 Replies
- Altera_Forum
Honored Contributor
When I transfer data, I use a very simple and relatively fast connection via GPIO and Labview. For that you need a Labview card and box (expensive but in most university labs available) with digital I/O pins and a clock input. Then you connect the I/O pins from Labview to some pins of the GPIO port.
The transfer rate is 1Mbit/s for each connected data pin with my labview card. I tried to write to the SD card once, but failed when my SD card was not even recognized by the board. There is also no example to actually write to the SD card, only to read from it. - Altera_Forum
Honored Contributor
Does anyone have a method of writing to th SD card without using LabView?
- Altera_Forum
Honored Contributor
You could start with the DE2_115_SD_CARD demonstration project: it includes a function SDHAL_WriteData in the file sd_hal.c. You might be able to write using this function, if you find an SD card that is recognized by the board.
I see that this demonstration is for the DE2-115 board; hopefully there is a similar demonstration for the DE2 board. - Altera_Forum
Honored Contributor
Awesome. Thanks for the advice I will have to take a look at the code. Do you know if there is a link on the altera website for the demonstration files? I can't seem to find them.
What exactly is the trick to find an SD card that is recognized by the DE2 board? SDHC? Non SDHC? MicroSD into adapter? Certain brands? - Altera_Forum
Honored Contributor
you can find the files here: http://www.terasic.com.tw/cgi-bin/page/archive.pl?language=english&categoryno=139&no=502&partno=4
In order to download, you need to sign up for a Terasic account. - Altera_Forum
Honored Contributor
What is the trick to finding an SD card that is recognized by the DE2 board? I've tried two cards now (PNY and Sandisk both 2GB) and neither one is being recognized.
- Altera_Forum
Honored Contributor
I would ask Terasic (I think it's [email protected]); they should know, because they ship the high end boards with SD cards.
- Altera_Forum
Honored Contributor
Hello everyone! I really appreciate your help!
David Pavid: I don't have a labview card, but its a nice idea! I adapted the code for the DE2-115 to run in DE2. I am running the program but I am having problems with the sd card that is not being recognized. I tested 2 SD cards, both microSD into adapters, and both fail. (1gb KINGMAX microSD and 8gb microSDHC Class4 that doesn't says the brand). Anyone has already tested a old simple card (32-128mb) and without adapters? I am going to contact terasic, if I get answers I post here. - Altera_Forum
Honored Contributor
The SD card (2 GB ) that came with the DE4 card can be mounted by the demonstration project design. Therefore I don't think that it is the size of the SD card.
- Altera_Forum
Honored Contributor
Hello! I'm still trying to write a .txt file in SD Card. I searched a lot in internet but I couldn't find the solution!
If someone knows a way please tell! Thank you!