Page 1 of 1

ESP32 - Analog read GPIO 33 affects interrupt on pin GPIO 36?

Posted: Wed Jun 07, 2023 12:54 pm
by YigalB
In the ESP32 design, GPIO 36 is connected to a push button and configured as input (that's all it can be anyway). and used to trigger interrupts. This is working well.

I just started to use GPIO 33 as an analog input, to read from a potentiometer, using AnalogRead command. This is working well, tested standalone.

When tested with the main software, it seems that AnalogRead of GPIO 33 is triggering an interrupt on GPIO 36.
When the AnalogRead of GPIO
  1. [Codebox=cpp file=Untitled.cpp]
[/Codebox]33 is disabled, the problem stops. Is there a reason for that?

Another thing: I use PWM (channel 0) - I don't think that is relevant because the ADC is not related to the PWM, right?

Re: ESP32 - Analog read GPIO 33 affects interrupt on pin GPIO 36?

Posted: Thu Jun 08, 2023 9:34 am
by YigalB
[/Codebox]33 is disabled, the problem stops. Is there a reason for that?
I am not sure I understand the question - GPIO 33 is not disabled. It is used for analog read.
When analog read, the problem exists interrupts occur suddenly on GPIO 36.
When no analog read from GPIO 33 is done - no problem.

Re: ESP32 - Analog read GPIO 33 affects interrupt on pin GPIO 36?

Posted: Thu Jun 08, 2023 5:46 pm
by YigalB
I think I have the solution - can anyone confirm?
GPIO36 ,aka VP, is connected to the ADC's voltage.
So any AnalogRead() on another pin (GPIO33 in my case), caused interrupts to be triggered on GPIO36.
So GPIO can't be used as input when the ADC is used. At least not with interrupts.

When I stopped using GPIO36, moving the push button to another free GPIO, problem was solved.

Re: ESP32 - Analog read GPIO 33 affects interrupt on pin GPIO 36?

Posted: Thu Jun 08, 2023 6:15 pm
by boarchuz
See ESP32 errata, 3.11

Re: ESP32 - Analog read GPIO 33 affects interrupt on pin GPIO 36?

Posted: Fri Jun 09, 2023 6:30 am
by YigalB