1

I am wondering if someone could explain this to me.

I want to calculate sampling rate of external ADC. I am using ADS8320 which has max sampling rate of 100kHz, with Arduino MEGA 2560. SPI divider is set to 128, which makes SPI frequency 125kHz. Baud rate is 115200 (I am not sure if this is important).

Thanks a lot!

asked Aug 31, 2017 at 13:56
1
  • 1
    If you have the ADC then you can write a little sketch to time it yourself. So you will know for sure. Commented Aug 31, 2017 at 14:49

2 Answers 2

1

To get an idea of the sampling rate write a loop that takes 10,000 measurements and time how long it takes. You have your sample rate, not perfect but gives you some idea.

long start = millis();
// the loop
Serial.print( 10000000/(millis() - start) ); 
Serial.println(" samples per second");
answered Sep 1, 2017 at 10:42
0

Easy.

  1. Based on your set up, figure out the spi speed.

  2. Take a look at the adc datasheet, figure out it's frame of transmission . Aka how many pulses per frame / sampling.

  3. The product of the numbers in 1 and 2 gives you the minimum time per frame. The inverse of it is the maximum transmission in your application. That speed is cap by the devices own max sampling rate (100ksps).

  4. Your actual sampling rate will depend on your specific application but it should not go above the number obtained in 3.

  5. You may need to factor in other timing requirements as well so read the datasheet carefully. But the gist is the same.

answered Aug 31, 2017 at 16:08

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.