Pages: [1] 2   Go Down
Author Topic: A/D sampling frequency  (Read 2247 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Ottawa,Canada
Offline Offline
Jr. Member
**
Karma: 0
Posts: 82
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

all the way up to 1M sample/sec
Logged

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11730
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, then the maximum sampling rate is 1 MHz?
Logged

The Netherlands
Offline Offline
Full Member
***
Karma: 1
Posts: 139
MKDS hacker and Programmer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, then the maximum sampling rate is 1 MHz?
Yes, but only under perfect conditions.
Logged

Subscribe my youtube channel: http://www.youtube.com/user/MKDS3

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Ottawa,Canada
Offline Offline
Jr. Member
**
Karma: 0
Posts: 82
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
     
 
Logged

The Netherlands
Offline Offline
Full Member
***
Karma: 1
Posts: 139
MKDS hacker and Programmer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Subscribe my youtube channel: http://www.youtube.com/user/MKDS3

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Ottawa,Canada
Offline Offline
Jr. Member
**
Karma: 0
Posts: 82
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.atmel.com/Images/doc11057.pdf
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks.
Logged

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11730
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11730
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes ... You'd be very kind
Logged

Pages: [1] 2   Go Up
Jump to: