I am now successfully writing a 512 byte block to the SD card at 50 MHz! It's been very difficult getting to this point.
My next step is to try to write 60,000 blocks in a row (about 30 megabytes) and benchmark how fast the card can actually do it. This will tell me how many of these I will need to run in parallel to do laserdisc video capturing.
Actually I'm trying to do something similar - writting 4bits of data at 16MHz from GPS RF frontend. RPi could probably do it, but there's to much RF noise around it. Unfortunately, I do not know much about VHDL so I was unable to figure out where are the ADC input pins in you code? I located SD card pins in constraints file, but no ADC-related pins.
ReplyDeleteThanks,
Sebastian (hwhack at gmail com)
It's been a while, but as I recall I never hooked up the ADC. I was just trying to write to the SD card as fast as possible and I believe I just wrote a static pattern. Once I found that the SD card could not write as fast as I needed it to, I gave up on proceeding any further.
ReplyDeleteJust FYI: I've been able to get ~23MB/s of sustained write over 1GB of data with a class 10 SDHC card (~10MB/s with class 4). I added CMD25 support to your code and that's basically it (and ported to Verilog, what was a real pain).
ReplyDeleteHi Sebastian,
ReplyDeleteThat's great news. I just checked my code and it already is using CMD25 so I am confused. What am I missing here?
Also can you post the specific model of card you had this success with? I may want to pick one up and experiment with it. I recently got a card which claims to support 45 MB/s write speed but have not tested it yet (I am very skeptical! hehe)
Well, maybe your code has CMD25, but I guess you never released it :). The only version I found out there has a single CMD24 call. Can you post the latest version somewhere? I could compare if there is any speed difference.
ReplyDeleteThe card model is: www.sandisk.com/products/memory-cards/sd/ultra-uhs-1-class10-30mbs
However I found that it actually writes a lot faster then it should (class 10 is only up to 10MB/s, I get 23MB/s which is close to the interface maximum). I guess that's because raw, continuous CMD25 write is not a real use case and manufacturers are accounting for any discontinuities, FAT, fragmentation etc in their benchmark.
Hi Matt,
ReplyDeleteI am currently working on an SD controller for my DECA fpga board & I stumbled upon your work/blog. I am having some issues with writing and I would like to see your implementation to get a better understanding. Can you send me your vhdl source code?
Hi Matt,
ReplyDeleteI am currently working on an SD controller for my DECA fpga board & I stumbled upon your work/blog. I am having some issues with writing and I would like to see your implementation to get a better understanding. Can you send me your vhdl source code?