Skip to content

Commit 928b796

Browse files
aethanielcmaglie
authored andcommitted
Removing ADC averaging
Signed-off-by: Thibaut VIARD <thibaut.viard@atmel.com>
1 parent 06058c6 commit 928b796

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cores/arduino/wiring.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ void init( void )
109109

110110
ADC->INPUTCTRL.reg = ADC_INPUTCTRL_MUXNEG_GND; // No Negative input (Internal Ground)
111111

112-
// Averaging (see table 31-2 p.816 datasheet)
113-
ADC->AVGCTRL.reg = ADC_AVGCTRL_SAMPLENUM_64 | // 64 samples
114-
ADC_AVGCTRL_ADJRES(0x04ul); // Adjusting result by 4
112+
// Averaging (see datasheet table in AVGCTRL register description)
113+
ADC->AVGCTRL.reg = ADC_AVGCTRL_SAMPLENUM_1 | // 1 sample only (no oversampling nor averaging)
114+
ADC_AVGCTRL_ADJRES(0x0ul); // Adjusting result by 0
115115

116116
analogReference( AR_DEFAULT ) ; // Analog Reference is AREF pin (3.3v)
117117

0 commit comments

Comments
 (0)