Peripherals—IP2022 User’s Manual 296 www.ubicom.com 4.7.1 ADC Reference Voltage The reference voltage (Vref) can come from either the RG3 port
pin or from the AVdd supply voltage. If AVdd is used, the RG3 port
pin may be used as a channel of analog input or as a general-
purpose port pin.
Vref  defines  a  voltage  level  which  reads  as  one  increment  of
resolution  below  the  full-scale  voltage.  The  full-scale  voltage
reads as 0x3FF, so the Vref voltage reads as 0x3FE and the A/D
converter  resolution  is  10  bits.  Table 4-10  shows  the  values
reported at the upper and lower limits of the ADC input voltage
range.
                  Table 4-10  ADC Values
Vin Voltage
ADC Value 0V 0x000 Vref/0x3FE 0x001 Vref 0x3FE Vref + (Vref/0x3FE) 0x3FF