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.

CCS/TMS320F28377D: DMA and SPI interface

Part Number: TMS320F28377D


Tool/software: Code Composer Studio

Dear All

 I am interested in the writing of information (number of words=40) to a SPI serial RAM with a process that do not need to use interrupts. This write process will occur with a 120 us period.

 Th SPI FIFO has only 16 words. I would like to know, assuming that the 40 words are stored in the DMA region, if is possible to configure the SPI interface to write the serial RAM, without the use of interrupts?

 I have not much experience with DMA, so I would like to hear your comments about this approach, or others that may overcome this problem.

 Best regards,

Peter

  • Peter,

    Yes, you can configure SPI and DMA to work with each other without using interrupt. You need to configure SPI to generate DMA trigger source (SPITXDMA) when TXFFST <= TXFFIL and have a DMA channel trigger DMA transfer on SPITXDMA source.

    In your case, you need to do the following:-

    Total number of 16-bit words = 40
    BURST_SIZE = 4 (Actual BURST_SIZE is actually 5 )
    TRANSFER_SIZE = 7 (Actual TRANSFER_SIZE is actually 8). So, total number of data's transferred is 40
    MODE.DATASIZE = 0 (16 bit data transfer)
    MODE.ONESHOT= 0 (Transfer 5, 16 bit words are transffered per DMA trigger from SPI)
    DST_BURST_STEP = 0 (No change, this is because you want to keep writing to SPITXBUF)
    DST_TRANSFER_STEP = 0 (Same reason as above)

    SRC_BURST_STEP = 1 (I'm assuming you would have all the 40 words consecutively)
    SRC_TRANSFER_STEP = 1 (same as above)

    SRC_BEG_ADDR = (Address where you store 40 words)
    DST_BEG_ADDR = SPITXBUF address

    DMACHSRCSEL. CHx = 109 (SPITXDMAA. This configures DMA channel to start DMA transfer when SPITXDMAA event is generated)

    Regards,
    Manoj