This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SD card read/write using DMA



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.

**Attention** This is a public forum