I need help to interface my MSP430 with an SD-card using DMA. Started out with the code from slaa281B, worked well without DMA. I get the DMA writing working with some tweaking, but I don’t feel confident with the code. Is there any good code example that someone could share? I also looked at http://alumni.cs.ucr.edu/~amitra/sdcard/Additional/sdcard_appnote_foust.pdf.
No example, sorry. I got it working with DMA too, but my code belongs to my company.
However, DMA for SD-card only makes sense in a few cases, specifically during the 512byte read/write operation.In all other cases, a busy-waiting approach or an interrupt-based state-machine is much more suitable.Or the transfer can be done by carefully designed assembly code that exactly does one write every 8 SPI clock pulses.On SPICLK=MCLK, the saved time by DMA won't make up for the overhead for programming the DMA. (and for a command sending and checking the answer, you cannot do anything in the meantime anyway). On slower SPICLK, an interrupt-based approach is much simpler.Just during the data burst, it makes some sense, giving you 2048 MCLK cycles (on fastest SPI clock) during which you can do something else.
_____________________________________Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.