ESP32 add AnalogSetAttenuation

Post here to discuss any new features, components, chips, etc, that you would like to see in Flowcode.
Post Reply
stefan.erni
Valued Contributor
Posts: 752
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

ESP32 add AnalogSetAttenuation

Post by stefan.erni »

Hi Ben

Is it possible to add a command for all the AD converter from the ESP32 to use analogSetAttenuation?

regards

Stefan


https://espressif-docs.readthedocs-host ... /adc.html#
Analog set:
AD_2022-07-22_12-27-39.jpg
AD_2022-07-22_12-27-39.jpg (38.42 KiB) Viewed 1265 times

BenR
Matrix Staff
Posts: 1726
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 438 times
Been thanked: 602 times

Re: ESP32 add AnalogSetAttenuation

Post by BenR »

Hi Stefan,

Thanks for the suggestion. It was there previously but a bit reduced in terms of functionality and visibility.

I've updated the ESP32 ADC definitions so now it should show the correct max voltage in the Vref property and also catch and implement this in the CAL C code.

Let me know how you get on.

stefan.erni
Valued Contributor
Posts: 752
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

Re: ESP32 add AnalogSetAttenuation

Post by stefan.erni »

Hi Ben

It works with the attenuation settings.
But it is a little confusing what the ESP32 pico delivers.
In order to get to the maximum I have to apply the following voltage:

Vref Vin
950mV 1.1volts
1250mV 1.39 volts
1750mV 1.89 volts
2450mV 3.2 volts

I'm not interested in the small errors at the moment, but why is
for the 2450mV reference 3.2 volts necessary?
But even worse, I should actually have the 3.2 volts, but I have no idea why this is already working...

regards

Stefan

Post Reply