Is there an easy way to set the sampling frequency of the analogread( ) function or by any other mean (via interrupt, timer... ) ?
We're trying to acquire 4 analog signals at the specific sampling frequency of 2kHz.
Thanks for your help.
Yes it is. But if you are only in need of 2kHz samples I think the default rate is enough for you since it samples at around 8.620 samples per second. That means that the analogread() takes about 116μs to be done.
However DUE has a 12 bit ADC downscaled by software at 10bits to fit other arduinos.
If you still want to know more about changing the sampling frequency here is a paper that you may find handy.http://www.marulaberry.co.za/index.php/tutorials/code/arduino-adc/
Bare in mind that DUE does not use a 16MHz clock and calculations with other arduinos may differ.