SparkFun Forums 

Where electronics enthusiasts find answers.

Everything ARM and LPC
By Natalia
#191566
I am writing to see if someone can give me a hand with the ADC on my LPC4337
I'm doing a practice in which I have to sample two signals at 200Hz.
I need to sample at least 500 points for each cycle.
Since I know that the LPC4337 ADC have a sampling frequency of 400 KHz I assumed that is possible.
However the maximum speed that achievement, sampling with DMA, ADC0 Channel 2 and ADC1 channel 2, is 33,8kHz. which represents approximately 169 samples per cycle.
(To reach that number, (33,8KHz) I turn on and turn off a exit pin, when finished reading the 2 ADC and I measure it with an oscilloscope)
If I only activated one channel and one ADC, the actual sample frequency is 79.9 KHz. (Which also remains poorly)
all those test was with BURST Mode disabled. If I configurate the ADC in interruption mode instead of DMA, it is slower yet.
Finally I tryed enabling Burst Mode, and remove the DMA and interrupts.
I made a loop and I kept waiting for the data inside a while (1), Channel 2 and Channel 3 ADC0.
Code: Select all
/* Waiting for A/D conversion complete */
while (Chip_ADC_ReadStatus(LPC_ADC0, ADC_CH_SEN, ADC_DR_DONE_STAT) != SET) {}
/* Read ADC value */
Chip_ADC_ReadValue(LPC_ADC0, ADC_CH_SEN, &dataADC0);
Now the frequency is 100KHz approx. almost exactly 500 points per cycle . But as I start to make something, this consume cycles and the frecuency falls, obviously I do not get the amount of points I need.

The ADC is configured with a 400KHz sampling frequency and with 10-bit resolution.
the test were without interfering with the reading of the ADC.
Questions:
What is the best and fastest way to read the two signals with the ADC?
Is it possible to sample faster than 100KHz?
Is this a limitation?
Are there some extra settings I should do?
I also need to read the two signals simultaneously.
Is this possible?
if I use the Channel 2 on ADC0 and the channel 2 on ADC1,
Are the readings simultaneous ? or sampled first one and then the other.

Any help you can give me I would appreciate it. Sorry for my english.
Thank you so much.
Natalia
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]