MSPM0G1107: ADC With DMA

Part Number: MSPM0G1107
Other Parts Discussed in Thread: SYSCONFIG

ADC is configured with 40MHZ sourced from ULPCLK . Is it possible sample 500KHZ signal with ADC channel 1 and store the result in user buffer using DMA.
If it possible, please share sys configure of ADC with DMA.

  • Hello Baskar,

    In fact, we already have the demo in our SDK, you can refer to this demo: adc12_max_freq_dma as a reference

    BR,

    Janz Bai

  • Here i have discussed about the ADC capture speed through DMA(512 samples). Our discussion is the 500Khz pulse input signal capture through ADC channel 1 with the sampling rate of 0.1uS. 
    As per the sampling rate ON state should have 10 sample and OFF state should be 10 sample. But we are getting 1 or 2 sample that also not proper sequence, so is it to confirm the 500Khz input signal with sampling time of 0.1uS for 10 sample count possible with this MSPM0.
    Please find the adc12_max_freq_dma capture log ADC 512 sample data.

  • Hello ,

    Could you please share your ADC configuration in Sysconfig with me? You can share the Sysconfig file with me or just figure is ok. I want to check some configuration of ADC which may affect ADC operation.

    BR,

    Janz Bai

  • Please find the "adc12_timer_sequence_DMA" sys cfg modified file for your review.

    /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --device "MSPM0G350X" --part "Default" --package "LQFP-64(PM)" --product "mspm0_sdk@2.09.00.00"
     * @v2CliArgs --device "MSPM0G3507" --package "LQFP-64(PM)" --product "mspm0_sdk@2.09.00.00"
     * @versions {"tool":"1.25.0+4268"}
     */
    
    /**
     * Import the modules used in this configuration.
     */
    const ADC12  = scripting.addModule("/ti/driverlib/ADC12", {}, false);
    const ADC121 = ADC12.addInstance();
    const SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL");
    const TIMER  = scripting.addModule("/ti/driverlib/TIMER", {}, false);
    const TIMER1 = TIMER.addInstance();
    
    /**
     * Write custom configuration values to the imported modules.
     */
    ADC121.$name                          = "ADC12_0";
    ADC121.trigSrc                        = "DL_ADC12_TRIG_SRC_EVENT";
    ADC121.adcMem2chansel                 = "DL_ADC12_INPUT_CHAN_1";
    ADC121.adcMem3chansel                 = "DL_ADC12_INPUT_CHAN_1";
    ADC121.adcMem4chansel                 = "DL_ADC12_INPUT_CHAN_1";
    ADC121.adcMem5chansel                 = "DL_ADC12_INPUT_CHAN_1";
    ADC121.adcMem6chansel                 = "DL_ADC12_INPUT_CHAN_1";
    ADC121.adcMem7chansel                 = "DL_ADC12_INPUT_CHAN_1";
    ADC121.adcMem8chansel                 = "DL_ADC12_INPUT_CHAN_2";
    ADC121.adcMem9chansel                 = "DL_ADC12_INPUT_CHAN_2";
    ADC121.adcMem9trig                    = "DL_ADC12_TRIGGER_MODE_TRIGGER_NEXT";
    ADC121.enabledInterrupts              = ["DL_ADC12_INTERRUPT_DMA_DONE"];
    ADC121.configureDMA                   = true;
    ADC121.sampCnt                        = 1;
    ADC121.samplingOperationMode          = "sequence";
    ADC121.endAdd                         = 9;
    ADC121.repeatMode                     = true;
    ADC121.enableFIFO                     = true;
    ADC121.sampleTime0                    = "90 ns";
    ADC121.enabledDMATriggers             = ["DL_ADC12_DMA_MEM11_RESULT_LOADED","DL_ADC12_DMA_MEM1_RESULT_LOADED","DL_ADC12_DMA_MEM3_RESULT_LOADED","DL_ADC12_DMA_MEM5_RESULT_LOADED","DL_ADC12_DMA_MEM7_RESULT_LOADED","DL_ADC12_DMA_MEM9_RESULT_LOADED"];
    ADC121.subChanID                      = 1;
    ADC121.powerDownMode                  = "DL_ADC12_POWER_DOWN_MODE_MANUAL";
    ADC121.sampleTime1                    = "90 ns";
    ADC121.adcPin0Config.$name            = "ti_driverlib_gpio_GPIOPinGeneric1";
    ADC121.DMA_CHANNEL.$name              = "DMA_CH0";
    ADC121.DMA_CHANNEL.addressMode        = "f2b";
    ADC121.DMA_CHANNEL.peripheral.$assign = "DMA_CH0";
    ADC121.adcPin1Config.$name            = "ti_driverlib_gpio_GPIOPinGeneric2";
    ADC121.adcPin2Config.$name            = "ti_driverlib_gpio_GPIOPinGeneric3";
    ADC121.peripheral.adcPin0.$assign     = "PA27";
    ADC121.peripheral.adcPin1.$assign     = "PA26";
    ADC121.peripheral.adcPin2.$assign     = "PA25";
    
    const Board = scripting.addModule("/ti/driverlib/Board", {}, false);
    
    SYSCTL.forceDefaultClkConfig = true;
    
    TIMER1.$name                       = "TIMER_0";
    TIMER1.timerMode                   = "PERIODIC";
    TIMER1.timerPeriod                 = "8 us";
    TIMER1.event1PublisherChannel      = 1;
    TIMER1.event1ControllerInterruptEn = ["ZERO_EVENT"];
    
    /**
     * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
     * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
     * re-solve from scratch.
     */
    ADC121.peripheral.$suggestSolution         = "ADC0";
    Board.peripheral.$suggestSolution          = "DEBUGSS";
    Board.peripheral.swclkPin.$suggestSolution = "PA20";
    Board.peripheral.swdioPin.$suggestSolution = "PA19";
    SYSCTL.peripheral.$suggestSolution         = "SYSCTL";
    TIMER1.peripheral.$suggestSolution         = "TIMA0";
    

  • Hello Baskar,

    I have checked the datasheet of M0G1107, that the max ADC sampling frequency in 12-bit is just 4Msps, which is 0.25us, so the 90ns sampling window you set is too small, by the way, what is the reference of ADC, it is VDDA, or VREF?

    BR,

    Janz Bai

  • Default VDDA 3.3V as ADC reference voltage. As per your suggestion configured the ADC sampling time to 0.25us, but even it is capturing sampling data is not proper as below for your reference. 

  • Hello, 
    As mentioned VDDA 3.3V as ADC reference and please clarify the ADC sample collection latency time is based on ADC number of channels. Here MSPM0 has 12 channels so one ADC sample collection will take 12 FIFO time, is it correct?
    Clarify us this reference thread.:
    MSPM0G3507: DMA mode example of using ADC - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums