I do two conversions (ratiometric measurement) with AREF = AVCC = VCC = 3 x AAA battery. AVCC is connected to VCC via an LC network as recommended in the data sheet of the ATmega328P. I would like these two measurements to be as accurate as possible.

Immediately after, I do a third conversion (absolute measurement) with AREF = internal 1.1V reference. This measurement does not have to be particularly accurate.

As recommended in the data sheet, I discard the result of the first conversion after switching von AVCC to internal 1.1V reference (I do 16x oversampling, throwing away the first of 17 conversions).

Also, as recommended in the data sheet, I connected the AREF pin with a (1nF) cap to GND.

I am very satisfied with the accuracy of the measurements.

However, when switching from AVCC (3.8V) to internal 1.1V reference, it seems to take ~125us for the cap to discharge and the voltage to stabilize:

enter image description here

Without the 1nF cap it seems to take less than 10us for the voltage to settle:

enter image description here

Now I am wondering if I should:

  1. Just skip the 1nF cap between AREF pin and GND, assuming that AVCC is clean enough from noise since it is connected to VCC via the LC network? For oversampling, some noise is desirable anyway, right?
  2. Wait ~125us after switching voltage reference before starting the next conversion?

What would you recommend?

  • \$\begingroup\$ We have little idea of your requirements, so asking us to choose is not beneficial to you. You’ve determined your two options, so choose your poison. I’ve faced a similar situation with a mega128. I just designed the code so that the charge/discharge time of the capacitor on AREF was allowed for. \$\endgroup\$
    – Kartman
    Commented Jun 11, 2023 at 21:38
  • \$\begingroup\$ The requirement is just: 1. Convert with AVCC as reference 2. Convert with internal 1.1V reference + following the recommendation of a cap between AREF pin and GND. But your comment sounds reasonable: I have to decide if I want the cap and wait for it to discharge or skip the cap and maybe have some noise which is maybe beneficial for oversampling. \$\endgroup\$ Commented Jun 12, 2023 at 9:59


Your Answer

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

Browse other questions tagged or ask your own question.