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.

TM4C1294NCPDT: SPI DIRECT MEMORY ACCESS - EXAMPLE CODE

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: ADS1274, EK-TM4C1294XL

Tool/software:

Hi TI Team,

We are integrating TM4C1294NCPDTT3 microcontroller with ads1274 ADC module. From SSI_DR_DATA(0x40008008) register ,we need to transmit this value into the other variable by direct memory access method. 

Kindly provide a example code for SPI DMA method.

Thanks and Regards,

A. Ajith Kumar

  • Hi,

      You can refer to the example C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c1294xl\udma_demo. This example demonstrates memory to memory transfers and memory to UART peripheral transfers. As you can see in the example code, UART1_BASE + UART_O_DR (the UART shift register) is used as the destination address for uDMA transfers. 

    //
    // Set up the transfer parameters for the uDMA UART TX channel. This will
    // configure the transfer source and destination and the transfer size.
    // Basic mode is used because the peripheral is making the uDMA transfer
    // request. The source is the TX buffer and the destination is the UART
    // data register.
    //
    MAP_uDMAChannelTransferSet(UDMA_CHANNEL_UART1TX | UDMA_PRI_SELECT,
    UDMA_MODE_BASIC, g_ui8TxBuf,
    (void *)(UART1_BASE + UART_O_DR),
    sizeof(g_ui8TxBuf));

    You can change to the below example setting for transfers from memory to SSI1 peripheral. You will need to change the rest of the code in the example accordingly from UART1 to SSI1. 

    MAP_uDMAChannelTransferSet(UDMA_CHANNEL_SSI1TX| UDMA_PRI_SELECT,
    UDMA_MODE_BASIC, g_ui16TxBuf,
    (void *)(SSI1_BASE + SSI_O_DR),
    sizeof(g_ui16TxBuf));