ESP32 ADC not working

Any bugs you encounter with Flowcode should be discussed here.
simisv
Posts: 6
http://meble-kuchenne.info.pl
Joined: Wed Oct 19, 2022 7:54 am
Been thanked: 1 time

Re: ESP32 ADC not working

Post by simisv »

Hi

On Wroom module ADC1 is safe with WiFi and Bluetooth,
I'm guessing is the same with S3 module , not sure yet .
Definitely after some tests I will know ( but first I need to build the prototype board).
Anyway, on this project is not used.
Thanks

Xbiotec
Posts: 216
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Flowcode v10 Re: ESP32 ADC not working

Post by Xbiotec »

I'm on customer side in Asia and i'm trying to use on ESP32-u4wdh Pin20 AN36 on (Flowcode Strange notation) who on ESP32 is Pin20 GPIO13 on ADC2_Ch4, not on same Channel as others.
Why Pin name are different ?

for information, I'm using ESP32-u4wdh since long time
ESP32 pin20.png
ESP32 pin20.png (13.4 KiB) Viewed 783 times
It's not possible to adjust channel in component properties.
- ESP32 reboot
UART1 Started, [0;31mE (2419) adc_oneshot: adc_oneshot_config_channel(150): invalid channel[0m
14:27:27.245 -> ESP_ERROR_CHECK failed: esp_err_t 0x102 (ESP_ERR_INVALID_ARG) at 0x400d80a9
14:27:27.279 -> file: "C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\ESP\ESP_CAL_ADC.c" line 109
14:27:27.285 -> func: FC_CAL_ADC_Enable_1
14:27:27.285 -> expression: adc_oneshot_config_channel(adc_handle, Channel, &config)
14:27:27.285 ->
14:27:27.285 -> abort() was called at PC 0x40086c1b on core 0
It's not a question of delay in main loop.

I have remove everything on my program to check if the problem is not linked to another component.
Same problem

I ahev test all ADC components to see if there is at least one where we could change the Channel.
No way

I'm not using WIFI nether Bluetooth

Program attached
ESP32-u4wdh datasheet attached


So I think it's ADC component problem or ADC cal problem , I don't know
Please find a way asap to be able to use ADC

As I said I'm on customer side and for me it's 15h27 !
thx
Attachments
esp32_datasheet_en.pdf
(970.45 KiB) Downloaded 6 times
ADCread_ESP32_U4WDH_V0.1.fcfx
(19.99 KiB) Downloaded 6 times
Seb

medelec35
Matrix Staff
Posts: 1996
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 630 times
Been thanked: 666 times

Re: ESP32 ADC not working

Post by medelec35 »

Hello Seb.
You don't need to use WiFi components, its just wifi is enabled by default.
THe reason being is more people use ESP32 for WiFi than they do for ADC.
Therefore if you use any ADC's that are ADC2 which is most, then they will cause a reset.
Have you tried just using ADC that are on inputs only at least then that will free up other pins for I/O or O/P tasks.
For example you can try An0, An3, An4, An5, An6 or An7?
Martin

Xbiotec
Posts: 216
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Re: ESP32 ADC not working

Post by Xbiotec »

Hello Martin,
I can not use another ADC, PCB already made. (20 PCBA)
You mean in flowcode, WiFi is enable by default?
So how to disable and solve this ADC problem?
Seb

Xbiotec
Posts: 216
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Re: ESP32 ADC not working

Post by Xbiotec »

Hello,
Nothing to tell me?
Seb

mnfisher
Valued Contributor
Posts: 1554
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 138 times
Been thanked: 741 times

Re: ESP32 ADC not working

Post by mnfisher »

Can you try the code on page 1 of this topic - check the output from UART (using PuTTY or similar) - it will let you know if the pin is available etc?

Martin

Xbiotec
Posts: 216
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Re: ESP32 ADC not working

Post by Xbiotec »

Hi, the pin is available for ADC but on ADC2 channel4 , I'm sure, I have asked to Espressif, they said , no mistake on datasheet.
The problem is because ADC components in flowcode do not manage ADC2 Channel 4.
download/file.php?id=9356
Seb

mnfisher
Valued Contributor
Posts: 1554
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 138 times
Been thanked: 741 times

Re: ESP32 ADC not working

Post by mnfisher »

The code I posted on the previous page doesn't use the component - and should work correctly - however, it will take a bit of re-work in your code.

Xbiotec
Posts: 216
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Re: ESP32 ADC not working

Post by Xbiotec »

ok I will try

But Flowcode team must check and make it working on all ADC on FC10 for ESP32
Seb

Xbiotec
Posts: 216
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 35 times
Been thanked: 26 times

Re: ESP32 ADC not working

Post by Xbiotec »

mnfisher wrote:
Fri Jun 20, 2025 12:59 pm
The code I posted on the previous page doesn't use the component - and should work correctly - however, it will take a bit of re-work in your code.
Thx it's works after few modifications and AI help
Seb

Post Reply