how do I minimize ADC clock freq via a register?

I see from the data sheet of the micro controller that ADPS2-0 affect this, but I am not sure how in code to do this.

I'll continue to scour the forums but your help is appreciated

Thanks

The ADPSn bits are part of the ADCSRA register. You can set them using code like the following -

// ADC clock prescaler 8
ADCSRA |= (1 << ADPS1) | (1 << ADPS0);

That's untested but it should work. The exact combination of bits that you turn on affects the pre scaler, but you know that already from reading the data sheet :slight_smile:

Look up bit wise operations/bitmath for more information about what is going on, or search for something like "AVR set bit"

a.d:
The ADPSn bits are part of the ADCSRA register. You can set them using code like the following -

// ADC clock prescaler 8

ADCSRA |= (1 << ADPS1) | (1 << ADPS0);




That's untested but it should work. The exact combination of bits that you turn on affects the pre scaler, but you know that already from reading the data sheet :)

Look up bit wise operations/bitmath for more information about what is going on, or search for something like "AVR set bit"

Thanks!

Other than the prescaler for the ADC, is there another register I can write to so that I can slow the ADC clock even more?

Thanks

Why do you want to slow it? That will make the conversion time longer, and may affect the accuracy of the sample & hold circuit that is charged up prior to making the conversion.

CrossRoads:
Why do you want to slow it? That will make the conversion time longer, and may affect the accuracy of the sample & hold circuit that is charged up prior to making the conversion.

I need to perform DSP on an audio signal and want the bins to have a small frequency span for better granularity. This is for a spectrum analyzer display.