ADC insert values in wrong variables throught DMA

Showing results for 
Search instead for 
Did you mean: 

ADC insert values in wrong variables throught DMA

Contributor I

I'm using MKL25Z4 in order to use ADC to make 1024 samples that wiil go to an array in memory by using the DMA. After that I press a button and change it so that the DMA will send the samples for DAC and I encounter some problems:

  • For some reason it stops filling the array with samples after cell number 911 even thought I configured it for circular buffer of 2KB, why it stopped after cell 912 ?
  • It looks like after the cell 911 changes the DMA insert a sample from the ADC to one off my global variables, one named state which defines if I need the ADC or the DAC, all the other global variables are untouched, which effect my program, how can it be?
  • I see that some configurations make the CPU work while the DMA work , like the Auto-Aligened, why?
    I will appricate every answer or tip
Labels (1)
0 Kudos
1 Reply

NXP TechSupport
NXP TechSupport

Hello @darkWarrior735,

In the following link there's an example that uses the DMA ADC, also, in the SDK there's an example in demo_apps examples.

Best Regards,

Alexis Andalon

0 Kudos