Hi, i'm working with a tms320f28335 microcontroller. I need to configure the DMA to transfer data from the ADC to a an array of certain length. The ADC is configured to sample only one channel, namely ADCINA0. The ADC is triggered by EPWM. After that, the ADC is configured to take only one measurement of such channel. The interrupt of the ADC triggers the DMA. Here's the problem: as only one measurement is taken, thus the burst size is configured as one 16bit word:
// Configure the addresses. DmaRegs.CH1.SRC_BEG_ADDR_SHADOW = (Uint32)&AdcMirror.ADCRESULT0; DmaRegs.CH1.SRC_ADDR_SHADOW = (Uint32)&AdcMirror.ADCRESULT0; DmaRegs.CH1.DST_BEG_ADDR_SHADOW = (Uint32)AdcBufRaw; DmaRegs.CH1.DST_ADDR_SHADOW = (Uint32)AdcBufRaw; // Configure the bursts. Words to be transferred each burst. DmaRegs.CH1.BURST_SIZE.all = 0x0000; // One word per burst. DmaRegs.CH1.SRC_BURST_STEP = 0x0001; // Step to the next ADCRESULT register. DmaRegs.CH1.DST_BURST_STEP = 0x0001; // Go to the next position of the adc array. // Configure the transfer registers. DmaRegs.CH1.TRANSFER_SIZE = (ADC_BUFFER_LEN - 1); DmaRegs.CH1.SRC_TRANSFER_STEP = 0x0000; DmaRegs.CH1.DST_TRANSFER_STEP = 0x0000; // Will be ignored when WRAP occurs. // Configure wrap. DmaRegs.CH1.SRC_WRAP_SIZE = 0x000f; // Wrap after 15 words transferred (length of the ADCRESULT registers). DmaRegs.CH1.SRC_WRAP_STEP = 0x0000; // Go back to ADCRESULT0 and do not step. DmaRegs.CH1.DST_WRAP_SIZE = (ADC_BUFFER_LEN - 1); DmaRegs.CH1.DST_WRAP_STEP = 0x0000; // Go back to position 0 of adc array (Doesn't matter, as the array is only filled once).
But the DMA only transfers one word instead of the ADC_BUFFER_LEN (transfer size) that it is supposed to pass to the array. It only works if i change the burst size to two as follows:
DmaRegs.CH1.BURST_SIZE.all = 0x0001; // Two words per burst.
Am i missing something here?
Thanks in advanced. If i'm not being clear, please tell me so.