atsam: ADC pins need to be in input mode with pullups disabled
The ADC pins (on at least the sam3x8e) need to be configured in input mode with the internal pullups disabled in order to get accurate ADC readings. Reported by @bryanboettcher. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -49,6 +49,9 @@ gpio_adc_setup(uint8_t pin)
|
||||
| ADC_MR_STARTUP_SUT768
|
||||
| ADC_MR_TRANSFER(1));
|
||||
}
|
||||
|
||||
// Place pin in input floating mode
|
||||
gpio_in_setup(pin, 0);
|
||||
return (struct gpio_adc){ .chan = 1 << chan };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user