An ADC only computes the ratio of some input voltage with respect
to a supplied voltage. The ATMega128 ADC has a programmable voltage
reference selection. Bits REFS0 and REFS1 (bit 0 and 1 of ADMUX)
selects the source of voltage reference. Refer to page 242 of the
datasheet.
For most practical use, one can either use AVCC (analog supply voltage)
or the internal 2.56V reference (modes 1 and 3, respectively). Note that
both modes require that an external capacitor be connected between
the pin AREF and ground.
Copyright © 2006-02-15 by Tak Auyeung