AnsweredAssumed Answered

LPC1768 accumulate two ADC channels every 1ms

Question asked by David Kaplan on Mar 15, 2018
Latest reply on Mar 17, 2018 by David Kaplan

I would like to continuously read two ADC channels once every 1ms accumulating 500 values of each channel and perform a calculation every 500ms. I usually at slower speeds just use the ADC interrupt but this looks like a good candidate for DMA or DMA with a timer. What is the best way to do this? Does anyone have a step by step code example?

I would like to set the DMA source as the ADC, but the trigger to start a single ADC read f two of its channels from the timer.

When 500 readings x 2 have finished I expect the DMA interrupt to which I would restart the process but switching between two sets of 500 x 2 ADC values.

 

How do I configure the DMA to do this?

I guess transferring a single ADC reading is a 32 bit value even though the ADC is only 12bits.

So I would need 500x2x4x2 = 8000 ram bytes.

Any help or suggestions would be appreciated.

Outcomes