Page 1 of 1

ISR on pin 39 is broken by ADC / Touch Screen inputs on pin 32,33

Posted: Tue Jul 25, 2023 9:02 pm
by RacerX10
I have an application where I have a LCD touch screen on pins 32/33/25/26 (analog read on 32/33) and separately an ISR that is triggered on pin 39.

For some reason, the ADC on pins 32/33 for the touch screen, when enabled, are keeping the ISR from running in a timely manner. The ISR (it's measuring period / frequency of a signal on 39) works perfectly when I don't do the ADC on 32/33, but as soon as I uncomment that line of code that does the ADC, the values coming from the ISR on pin 39 are all wrong / random-ish.

I've tried moving the ISR to Core0, leaving everything else on Core1 but that didn't seem to help.

Any ideas ? Thanks in advance !

Re: ISR on pin 39 is broken by ADC / Touch Screen inputs on pin 32,33

Posted: Wed Jul 26, 2023 3:52 am
by boarchuz
Possibly ESP32 errata 3.11:
When certain RTC peripherals are powered on, the inputs of GPIO36 and GPIO39 will be pulled down for approximately 80 ns.


"Certain RTC peripherals" includes ADC1.

Re: ISR on pin 39 is broken by ADC / Touch Screen inputs on pin 32,33

Posted: Wed Jul 26, 2023 2:10 pm
by RacerX10
I guess I assumed the way that was worded that the 80ns thing was a one-time deal at power up

I'm experiencing this issue repeatedly.

I did move my ISR to trigger on GPIO12 instead, and the problem went away. It'll mean a PCB change but that does mean it's definitely something up with GPIO39 and ADC.