Constant Sampling Frequency

Hi there everyone!!

Is there any possible way to set a constant ADC frequency sampling for arduino board?
I'm working on a project that requires to sampling an audio signal with the frequency of 20KHz. I'm not pretty sure "analogRead()" works that fast so I'm looking for another option.

The default free running sampling frequency of an ATmega328 (and afaik all other Atmel chips at 16 MHz) is about 9,600 sps. This can be increased pretty drastically at a cost of accuracy by tweaking some registers.

Free running mode means you will have to deal with an interrupt (this will trigger every time a reading is complete) and do a direct read of the ADC register. Also this way you can read only one analog input.

Now you have that set: what are you going to do with your sample data? An Uno can hold no more than 0.2 seconds of 10-bit 20 kHz sampling data in its RAM.

hanifar:
Is there any possible way to set a constant ADC frequency sampling for arduino board?
I'm working on a project that requires to sampling an audio signal with the frequency of 20KHz. I'm not pretty sure "analogRead()" works that fast so I'm looking for another option.

I reckon that you need a faster microprocessor than the 16MHz Uno and Mega, etc.

Or maybe an external ADC with a fast sample rate.

...R

FYI, an Arduino DUE can trigger ADC conversions at 20 KHz.

An audio signal is usually sampled at 44.1 KHz (or more).