|
adc->CTRLA.bit.ENABLE = 0x00; // Disable ADC |
The board i'm using is a Grand Central.
In analogRead it enables the adc, reads the value then disables the adc. In 10 bit mode this works fine. In 12 bit resolution this approach somehow changes it to 11-bit resolution. The lowest bit is never set. If the adc is left enabled it works correctly.
ArduinoCore-samd/cores/arduino/wiring_analog.c
Line 352 in 0fd44a5
The board i'm using is a Grand Central.
In analogRead it enables the adc, reads the value then disables the adc. In 10 bit mode this works fine. In 12 bit resolution this approach somehow changes it to 11-bit resolution. The lowest bit is never set. If the adc is left enabled it works correctly.