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.

Question about DMA and ADC usage.

Other Parts Discussed in Thread: TMS320F28335, CONTROLSUITE

Hi!

I use TMS320F28335, CCS5.2.

I have a question about DMA and ADC usage.

I want to use DMA move data of ADC to the buffer.

ADC: 16ch x 16 bit,

want to move data length: 256 x 16 bit.

DMA config:

// Set up SOURCE address:
DmaRegs.CH3.SRC_ADDR_SHADOW = (Uint32) &AdcMirror.ADCRESULT0;// Point to first RESULT reg

// Set up DESTINATION address:
DmaRegs.CH3.DST_ADDR_SHADOW = (Uint32) &ADCbuffer[0]; // Point to beginning of ADCbuffer


If can I get the 256 data with once interrupt of DMA?

What can I do?

please help!

Thanks!

  • Hi, Source and destination pointers are alright. What about the rest of DMA configuration?
    you can trigger the DMA after all the ADC results are available.
    There is an example in controlSuite to explain the ADC transfer using DMA.
    You can refer to C:\ti\controlSUITE\device_support\f2833x\v140\DSP2833x_examples_ccsv5\adc_dma.

  • “you can trigger the DMA after all the ADC results are available.”
    Where does the 256 data save when all the 256 ADC results are available?
    I find that every 16 ADC data available will generate once interrupt, and the interrupt frequency is too high. I do not want that.
    I know that example. The example tigger ADC mang times and also every 16 ADC data available will generate onc interrupt.
  • Ok. So, you do not want interrupts from DMA after every 16 ADC result transfer.
    Try the following -
    Configure the DMA Burst Size to 16 and Transfer size to 16 (i.e. 16 bursts in one transfer).
    That way you'll get only one interrupt at the end of complete transfer.
    Make sure Source address wraps back to the first ADC result reg after every burst and Dest. address wraps back after end of transfer (16-bursts).

  • Thank you!

    As your suggestion, I try it, but the result is fail,too.

    my config is:

    DMACH3AddrConfig((Uint16*)&ADCbufferA[0],(Uint16*)&AdcMirror.ADCRESULT0);
     DMACH3BurstConfig(15,1,1);
     DMACH3TransferConfig(15,1,1);
     DMACH3WrapConfig(15,1,255,1);
     DMACH3ModeConfig(DMA_SEQ1INT,
                   PERINT_ENABLE,
                   ONESHOT_DISABLE,
                   CONT_ENABLE,
                   SYNC_DISABLE,
                   SYNC_SRC,
                      OVRFLOW_DISABLE,
                      SIXTEEN_BIT,
                      CHINT_END,
                      CHINT_ENABLE);
     StartDMACH3();

    The result is:

  • ADCbufferA
    0001 0000 0000 0000 0000 0000 0000 0000 0002 0001 0002 0002 0002 0002 0B03 0B3B
    0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
    FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
    FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
  • What exactly is getting copied in your code from source to destination. What is your observation from debug regarding this?
    Idea is to play with source and destination poinsters, burst/transfer size options. 

    More details in : www.ti.com/.../sprufb8d.pdf

    Figure 5. DMA State Diagram

    Source/Destination Address Pointers operation is also described in Page 17-18 of the above document.