Figure 6-2. ADC0.MUXPOS - Select VDDIO2DIV10 as Input for ADC0
Bit
7
6
5
4
3
2
1
0
Access
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Reset
0
0
0
0
0
0
0
Bits 6:0 – MUXPOS[6:0]
MUX Selection for Positive ADC Input
This bit field selects which analog input is connected to the positive input of the ADC. If this bit field is changed during
a conversion, the change will not take effect until the conversion is complete.
Value
Name
Description
0x00-0x0F
AIN0-AIN15
ADC input pin 0-15
0x10-0x15
AIN16-AIN21
ADC input pin 16-21
0x16-0x1F
-
Reserved
0x20-0x3F
-
Reserved
0x40
GND
Ground
0x41
-
Reserved
0x42
TEMPSENSE
Temperature sensor
0x44
VDDDIV10
VDD divided by 10
0x48
DAC0
DAC0
Other
-
Reserved
MUXPOS[6:0]
0x45
VDDIO2DIV10
VDDIO2 divided by 10
/*Select VDDIO2DIV10 as input for ADC0*/
ADC0.MUXPOS = ADC_MUXPOS_VDDIO2DIV10_gc;
The ADC has built-in support for oversampling. This is especially useful when measuring a DC voltage, as it mitigates
a lot of the periodic noise.
Figure 6-3. ADC0.CTRLB - Enabling Oversampling with 16 Samples
Bit
7
6
5
4
3
2
1
0
Access
R/W
R/W
R/W
Reset
0
0
0
Bits 2:0 – SAMPNUM[2:0]
Sample Accumulation Number Select
This bit field selects how many consecutive ADC sampling results are accumulated automatically. When this bit field
is written to a value greater than
0x0
, the according number of consecutive ADC sampling results are accumulated
into the ADC Result (ADCn.RES) register.
Value
Name
Description
0x0
NONE
No accumulation
0x1
ACC2
2 results accumulated
0x2
ACC4
4 results accumulated
0x3
ACC8
8 results accumulated
0x4
ACC16
16 results accumulated
0x6
ACC64
64 results accumulated
0x7
ACC128
128 results accumulated
SAMPNUM[2:0]
0x5
ACC32
32 results accumulated
/* Enable 16 oversamples*/
ADC0.CTRLB = ADC_SAMPNUM_ACC16_gc;
Enable ADC0.
TB3287
Measuring VDDIO2
©
2020 Microchip Technology Inc.
Technical Brief
DS90003287A-page 12