ADC Voltage Reference - LDmicro/LDmicro GitHub Wiki

A/D CONVERTER READ element has REFS field, that correspondent to the REFS1:0 - ADC Reference Selection Bits for Atmel AVR and
to the PCFG3:0 - ADC Configuration Control bits for the Microchip PIC MCU.
The parameter REFS=0 is backward compatible with the previous LDmicro releases.
image

  • Atmel AVR
    The reference voltage for the ADC (Vref) indicates the conversion range for the ADC. Single-ended channels that exceed Vref will result in codes close to 0x3FF(1023). Vref can be selected as either AVCC, internal 2.56V reference, internal 1.1V reference, or external Aref pin.

Avalable REFS value for ATmega2560 is: 0,1,2,3.
image

Avalable REFS value for ATmega8 is: 0,1,3.
image

  • Microchip PIC
    The analog reference voltages (positive and negative supply) are software selectable to either the device’s supply voltages (AVDD, AVss) or the voltage level on the AN3/VREF+ and AN2/VREF- pins.
    VCFGx - Voltage Reference bits have differed for PIC's, see the datasheets.
    image
    image
    You can select AVDD as Reference Voltage, VREF+ as the high-level limit of the Reference Voltage and VREF- as a low limit of the Reference Voltage.

Any questions to [email protected]