Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17259 Discussions

Write to SD card using Altera DE1 and Verilog

Altera_Forum
Honored Contributor II
2,398 Views

I'm using an Altera DE1 to implement a snake game on it. I developed a 4-bit counter, on my verilog code, to count the times the snake eats a dot. How can I save this 4-bit digit into the SD card?

0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
1,619 Views

You could, but if you wrote all the code yourself it might be bigger than the snake game. How about the 7 segment display, or the serial port?

0 Kudos
Altera_Forum
Honored Contributor II
1,619 Views

 

--- Quote Start ---  

You could, but if you wrote all the code yourself it might be bigger than the snake game. How about the 7 segment display, or the serial port? 

--- Quote End ---  

 

 

I'm using the 7 segment display to display the score of the user. But here is the thing, every time the user press reset the system should show the top 3 highest scores. I was thinking on saving these scores into the SD card and load them from it to display the scores on the 7 segment. Can I save the data displayed on the 7 segment to the SD card or is there a better option, other than the SD card, to save the scores?
0 Kudos
Altera_Forum
Honored Contributor II
1,619 Views

The SD card and the FLASH are your only non-volotile on-board options. I'd suggest the SD card could be considered easier to implement. 

 

This page; "how to use mmc/sdc (http://elm-chan.org/docs/mmc/mmc_e.html)" covers basic access of an SD card. I'd suggest it need not be very big. An SPI host is something an FPGA will easily accommodate. 

 

Cheers, 

Alex
0 Kudos
Altera_Forum
Honored Contributor II
1,619 Views

I was assuming it was to be written to a file on the SD card. Correctly handling a file system would be hard.  

 

If you just want to use the SD card for raw data that doesn't need to be read by anything else, then it isn't that hard to read/write a block of data. If you have NAND flash or EEPROM, on your board, that might be easier than the SD card.
0 Kudos
Reply