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.

DMA of two ADC14 channels on MSP432

I'm trying to modify Launchpad microphone example (BOOST-EDUMKII_MicrophoneFFT_MSP432P401R).

It works fine (after modification for FFT using q31 format). This example uses DMA in Pingpong mode.

Is it possible to program DMA to transfer 2 ADC channels in sequence mode e.g. A10 & A11  (ADCM0 & ADCM1)?

I do not know how to set dual source for DMA channel.

Thanks,

Chris

  • Chris,
    I am not sure if I understand correctly your request, but have you looked at the examples projects for driver library found in MSPWare? For example there is an example for dma_array_transfer_software_trigger.

    Chris
  • Hi Chris,

    This is very specific case pertaining to the fact that only one DMA channel 7 is assigned to ADC14.

    Can I transfer using DMA channel 7 two channels of ADC14?

    Thanks

    Chris

  • Super help... Never mind I switched to STM32L476..

  • dma_adc_example.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    /*
    * dam_adc_example.c
    *
    * --COPYRIGHT--,BSD,BSD
    * Copyright (c) 2014, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    * --/COPYRIGHT--*/
    #include "driverlib.h"
    /* Standard Includes */
    #include <stdint.h>
    #include <string.h>
    static bool isFinished;
    static uint32_t resultsBuffer[2];
    /* DMA Control Table */
    #ifdef ewarm
    #pragma data_alignment=256
    #else
    #pragma DATA_ALIGN(controlTable, 256)
    #endif
    uint8_t controlTable[256];
    int main(void)
    {
    /* Halting WDT */
    MAP_WDT_A_holdTimer();
    MAP_Interrupt_disableMaster();
    /* Zero-filling buffer */
    memset(resultsBuffer, 0x00, 2);
    isFinished = false;
    /* Setting reference voltage to 2.5 and enabling reference */
    MAP_REF_A_setReferenceVoltage(REF_A_VREF2_5V);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Chris,

      My appologies for the long delay over the holidays.  Yes, you can transfer two adc channels using one dma channel.  In the attached example, the ADC is set to sequence of channels mode and converts channels 0 and 1.  After the sequence is completed the ADC triggers the DMA (which is configured to auto-mode) which transfers the data from both channels to a memory location.

    Regards,
    Chris

  • Hi Chis, do you know a way to use repeat mode on ADC using DMA???, when I put ''true'' In repeatMode the resulsBuffer values remain in 0 and does not change.

**Attention** This is a public forum