MCUdude / MegaCoreX

An Arduino hardware package for ATmega4809, ATmega4808, ATmega3209, ATmega3208, ATmega1609, ATmega1608, ATmega809 and ATmega808
GNU Lesser General Public License v2.1
243 stars 47 forks source link

Fast ADC (AnalogReadFast) #180

Open chsumanbabu opened 1 year ago

chsumanbabu commented 1 year ago

Hi I want to increase the ADC sampling rate. I have tried the below mentioned ADC Prescaler code in wiring.c file. but it was not shown any improvement in ADC sampling rate. Please suggest.

Actual "#elif (F_CPU >= 16000000L) // 16 MHz / 128 = 125 kHz ADC0.CTRLC |= ADC_PRESC_DIV128_gc; "

Modified to "#elif (F_CPU >= 16000000L) // 16 MHz / 16= 1MHz ADC0.CTRLC |= ADC_PRESC_DIV16_gc; "