A/D sampling frequency

Since the Clock frequency is 84 MHz, I'd like to know if it is possibile to have an A/D sampling frequency of minimum 100KHz.
Thank you very much.

all the way up to 1M sample/sec

That's what the hardware can support, analogRead() out of the box takes 39us

Ok, then the maximum sampling rate is 1 MHz?

DanRek:
Ok, then the maximum sampling rate is 1 MHz?

Yes, but only under perfect conditions.

How can I reach 100Ksps if the AnalogRead() takes 39us? ...

RTFM
Search & Read the forums - people have talked about this before
may people have posted code (myself included)

my favourite way is use the PDC
others favour tight loops after modifying the analog read command
others rewrite the analog read

DanRek:
How can I reach 100Ksps if the AnalogRead() takes 39us? ...

Use native code. Take a look over here: http://asf.atmel.com/docs/latest/sam3x/html/group__sam__drivers__adc__group.html

ralphnev:
RTFM
Search & Read the forums - people have talked about this before
may people have posted code (myself included)

my favourite way is use the PDC
others favour tight loops after modifying the analog read command
others rewrite the analog read

May you link me the FM you say in "RTFM"? Thanks.

Thanks.

For the record my previous timing for analogRead() was with 1.5.4.

I've now installed 1.5.5 and the speed has increased dramatically (as the release notes
state), getting between 2.0us and 3.3us for analogRead() now.

Interestingly the slower case was consecutive reads of analog pin 0, whereas
reading analog pins 0 to 9 in turn was quicker... Done with an unrolled loop
of 10 consecutive analogreads.

MarkT:
For the record my previous timing for analogRead() was with 1.5.4.

I've now installed 1.5.5 and the speed has increased dramatically (as the release notes
state), getting between 2.0us and 3.3us for analogRead() now.

Interestingly the slower case was consecutive reads of analog pin 0, whereas
reading analog pins 0 to 9 in turn was quicker... Done with an unrolled loop
of 10 consecutive analogreads.

Very nice ... May you can give an example of your unrolled loop of 10 consecutive analogRead() code?
Thank u very much.

You need an example of 10 analogRead()'s in a row?

Yes ... You'd be very kind

Do one analogue read line.
Copy it.
Paste it nine times.

Thank you, I thought there was something more difficult. :slight_smile:

Grumpy_Mike:
Do one analogue read line.
Copy it.
Paste it nine times.

As to increase the sampling rate a convenient method is to repeat the analogRead (), how to know how many times I have to repeat this command on my input pin A0 of the ADC?
Thanks.

As to increase the sampling rate a convenient method is to repeat the analogRead (),

Do you mean sample rate? I think you might mean resolution.

MarkT:
I've now installed 1.5.5 and the speed has increased dramatically (as the release notes
state), getting between 2.0us and 3.3us for analogRead() now.

How to know that your unrolled loop of ten analogRead() takes between 2us and 3.3us? How did you measure it?
Thanks.