Page 1 of 1

routing reference voltage to GPIO pin while WIFI is enabled

Posted: Wed Jul 07, 2021 9:55 pm
by marclee
Device: ESP32-S2-WROOVER

As ADC1 of ESP32-S2-WROOVER does not support an external reference voltage, I need to route the internal reference voltage of ADC1 to one of the GPIO pins. Therefore I use the command adc_vref_to_gpio. Unfortunately that does not seem to work while WIFI is enabled.

Is there any other way to route the internal reference voltage to any of the GPIO pins, while WIFI ist enabled?

Re: routing reference voltage to GPIO pin while WIFI is enabled

Posted: Wed Aug 04, 2021 7:11 pm
by sraposo
Hi!

I also face a problem related to "adc_vref_to_gpio" function, since it results a error at compile time, although documentation at https://docs.espressif.com/projects/esp ... er_acquire#

"adc2_vref_to_gpio" cause no compile time error.

Re: routing reference voltage to GPIO pin while WIFI is enabled

Posted: Fri Aug 06, 2021 2:31 pm
by sraposo
To whom it may interest, a tip on ADC recalibration:

I could not find a way to make function "adc_vref_to_gpio" works but I've got other solution to deal with ADC calibration: to edit
"vref" field in "esp_adc_cal_characteristics_t" struct, that's the last parameter in function "esp_adc_cal_characterize".

After executing "esp_adc_cal_characterize", "vref" field is written with a value obtained from that ESP32 unit. So, you can modify such a content to trim the value ADC outputs, if you find factory-written value is not performing well.

Other fields in "esp_adc_cal_characteristics_t" struct may also useful to costumize ADC for some special need.