Adc input frequency

Hi I am totally newbie I have simple question what is the input frequency for each adc prescaler

// sampling rate is [ADC clock] / [prescaler] / [conversion clock cycles]
  // for Arduino Uno ADC clock is 16 MHz and a conversion takes 13 clock cycles
  //ADCSRA |= (1 << ADPS2) | (1 << ADPS0);    // 32 prescaler for 38.5 KHz
  ADCSRA |= (1 << ADPS2);                     // 16 prescaler for 76.9 KHz
  //ADCSRA |= (1 << ADPS1) | (1 << ADPS0);    // 8 prescaler for 153.8 KHz

Thanks in advance

These comments explain the calculation of sample rate. Sample frequency in Hz is 1/(sample time in seconds).

// sampling rate is [ADC clock] / [prescaler] / [conversion clock cycles]
// for Arduino Uno ADC clock is 16 MHz and a conversion takes 13 clock cycles
3 Likes

So prescaler 153.8 khz the input frequency = 153.8/13 ....11.830 khz or what?

Sampling rate = ADC clock / prescaler / conversion clock cycles
For example, with a prescaler of 32 the sampling rate is, 16MHz/32/13 = 38.462 kHz
and the ADC clock is 500kHz
Is that clear?

2 Likes

Yes clear and thank you
The ADC 500khz clock came from 16 mhz /32 ?
So I can use in your example 38.4khz input frequency on ADC pin ?

@jafal
38.4kHz is the sampling frequency.
The maximum frequency you can sample is always 1/2 of the sampling frequency
The the max input frequency on the ADC pin is 38.4kHz / 2 = 19.2kHz

2 Likes

Thanks a lot everything is clear

You are welcome
Have a nice day!

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.