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.

MSPM0G1507: ADC data result is wrong when using DMA with multiple ADC channels

Part Number: MSPM0G1507
Other Parts Discussed in Thread: MSPM0G3507, SYSCONFIG

Tool/software:

Hi Expert,

I use example project "adc12_max_freq_dma_LP_MSPM0G3507_nortos_ticlang" in sdk 2.2.0.5.

I change the ADC channels from 1 channel to 8 channels. I connect one channel to 3.3V and the other channels to ground. So, I can know if the adc result is correct or not.

I found the ADC data "gADCSamples" is wrong sometimes. The ADC result with 3.3V channel would "shift" to other ADC result. It seems that DMA doesn't move the data to data correctly.

Below is what I change.

in code, I change sample size from 1024 to 8.

#define ADC_SAMPLE_SIZE (8)

in sysconfig, I change below except enable adc channels.

adc12_max_freq_dma.syscfg

adc12_max_freq_dma.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
* Copyright (c) 2021, 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.
*
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Any idea where I am wrong?

BR,

Frank

  • Hi Frank,
    Can you confirm that you are sampling Channel 0 and that Channel 0 is fed the 3.3V while the other channels are fed from the ground? If that's the case, I would recommend first trying the original example (with the default values in SYSCONFIG & main file) and check if that works. If it does, I recommend changing the Conversion End Address from 7 to 10 and changing MEM7 to MEM10. Moreover, please consider the note from the 12.2.12.3 DMA and FIFO Operation section in the Userguide.

    Best Regards,

    Diego Abad