The ADC can use different reference voltages VREF, controlled in the REFSEL field of the CH[n].CONFIG register.
These are:
- Internal reference, VREF = 1.024V
- External reference (0.4 V up to VDD) , VREF provided by the EXTREF pin
- VDD
The AIN0-AIN3 inputs cannot exceed VDD, or be lower than VSS. The input ranges are also limited by the REFERENCE used. The condition
[V(P) - V(N) ] * 1/REFERENCE <= 1
must always hold true for valid measurements, otherwise the ADC will saturate and report the max value determined by the RESOLUTION.