Faster Analogread() on arduino mega2560

hello all, im looking to see how to read an analog input faster than the function analogread() can as i believe its to slow for my use.

Could anyone point me in the right direction? im thinking using the registers in the mega 2560 but reading the handbook can be a bit daunting at times.
many thanks!

You can change the clock divisor for the ADC to increase the sample rate from the default, but at much higher speeds accuracy will be reduced. Tutorial for ATmega328 (2560 is similar): https://www.gammon.com.au/adc

1 Like

At full 10-bit precision, you can run the ADC clock at 125 kHz for a sample rate of just over 9.26 kHz.

You lose a bit or two of precision when you run the ADC clock up to its maximum (1 MHz) but you can get a sample rate up to 74.074 kHz.

You can use Timer1 to trigger the ADC at regular intervals below the maximums.

What rate do you want?

2 Likes

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