AnalogReference for the Seeeduino Xiao

I am working on a fire detection system with the Seeeduino Xiao board. I have a thermistor attached, and so I’m reading a voltage which provides me with a temperature, after some mathematical juggling.

However, I find that the analogRefernce() function won’t compile: the compiler claims that EXTERNAL, INTERNAL, or DEFAULT are not declared within the scope of the code. Also, I don’t find any reference anywhere to an ARef pin, as exists on many Arduino variants.

So the XIAO appears to have a fixed ARef, internally chosen. Nominally, I would expect that to be 3.3 volts, but since it uses 5 volts as a power supply, that may not be right.

Can anybody enlighten me on this subject?

Thanks in. advance for any insights.

jrdoner

Can anybody enlighten me on this subject?

Probably a better question for SeeedStudio. While the board CAN be programmed by the Arduino IDE, the manufacturer wrote the plugin, and know the specifications very well.

Found in 'wiring_analog.h'. Only tried AR_INTERNAL1V1, it does compile.

typedef enum _eAnalogReference
{
AR_DEFAULT,
AR_INTERNAL1V0,
AR_INTERNAL1V1,
AR_INTERNAL1V2,
AR_INTERNAL1V25,
AR_INTERNAL2V0,
AR_INTERNAL2V2,
AR_INTERNAL2V23,
AR_INTERNAL2V4,
AR_INTERNAL2V5,
AR_INTERNAL1V65,
AR_EXTERNAL
} eAnalogReference ;

Thanks for the data. Oddly enough, when I use AR_INTERNAL2V5, I find I must use 3.14, not 2.5, as the reference voltage. It seems to be impossible to locate any detailed information of the accuracy and full range of the XIAO's ADC process.

My experience with Seeeduino XIAO and AnalogReference is:
only 4 settings are working:

analogReference(AR_DEFAULT);    // 3.3 V
analogReference(AR_INTERNAL1V0);
analogReference(AR_INTERNAL2V23);
analogReference(AR_INTERNAL1V65);

All others will be treated like "AR_DEFAULT": 3.3 V

General experience with XIAO and analogRead: it is not too accurate. :slight_smile:
So if you need accurate readings you may look for an external ADC.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.