Here we try to set internal reference voltage of ADC to the 1.8V or 2.4V by using functions
udrv_adc_set_mode(UDRV_ADC_MODE_1_8);
OR
analogReference(AR_INTERNAL_1_8).;
When we read ADC mode back with function “udrv_adc_get_mode()” it gives UDRV_ADC_MODE_3_3 (ie. Mode value - 1)
It seems that internal voltage is not getting set to the desired voltage level.
Thank you for update.
I think it should get reflected in library files also. So that it will not be selected by the developer if RAK3172 board is selected.
So if you want to accurately measure the analog value you are better of using an external Vref connected on a ADC channel and then compensate for the unknown Vin ??
Hi @carlrowan , I have also a question about the ADC. iam trying to read the battery voltage. Iam using a voltage divider of 1M and 1.5M ohm as recommended. So my max voltage on the ADC pin is 2.29V when iam using a 3.6V battery. But when i change the value on the ADC pin the analog value is not changing. Iam using ADC2 → WB-A1 for reading. When i turn the power supply voltage to 2.3V its still the same value as before… Really strange. Do you have some suggestion what the problem would be?
Having external voltage rerference for the module will not the improve accuracy on the built-in ADC. If can have fixed VDD level on RAK3172, you can use its ADC (vdd as reference) else it might be worth considering to check for an externa one or use RAK4631 (with programmable ADC reference.)
Hello @carlrowan ,
My vdd is a battery (3.6V max). So when the battery is getting empty the Vref is getting lower. That means that i cant make a battery measurement?