For the nano ble 33, the analogReference function limits you to a 4x gain (AR_INTERNAL2V4) for an input range of 0 to 2.4v. However, from what I read in the nRF52840 data sheet there is a configuration option to set the gain to 6 for an input range of 0 to 3.6 volts. Can someone help point me in a direction or method to enable me to configure the ADC input for a gain of 6? I tired to search the arduino source code but I could not find anything meaningful. I did find something in wiring_analog.c that I don't understand:
uint8_t analog_reference = DEFAULT;
void analogReference(uint8_t mode)
{
// can't actually set the register here because the default setting
// will connect AVCC and the AREF pin, which would cause a short if
// there's something connected to AREF.
analog_reference = mode;
}
Any help or suggestions would be appreciated.
thanks