Closed ricardoquesada closed 7 years ago
In case it helps, the period of the signal is 500 us (microseconds).
Possible that a slow rising edge plus noise creates enough of a falling edge to trigger a falling edge interrupt?
yes, it could be. I tried with a different signal, a square one with the same frequency, and it worked Ok.
The rising signal doesn't seem to have a "falling" section... but somehow it is triggering a NEGEDGE interrupt.
More info:
The Pink signal is the one that I want to evaluate. Since that type of signal was confusing the ESP32 falling signal I converted it to a digital one.
The Blue signal is square signal (digital). It uses a 7404 IC to generate it. Its input is the Yellow signal. The output is the square one, inverted, since it uses the 7404 inverter IC. This signal is being used as input in the ESP32.
The Yellow signal represents the interrupts generated by the ESP32. The interrupts are being triggered both at raising and falling no matter what I choose: NEGEDGE
, POSEDGE
, ANYEDGE
.
Very strange. The other day it was working Ok. Today no. I guess the ESP32 has some issues detecting the edges... or perhaps there is too much noise?
Any help would be greatly appreciated. Thanks.
it seems that it was just noise.... I guess.
I was able to solve it by converting the signal to 5v, then using a voltage divider and using the the new 3.3v signal which seems "cleaner" and now the interrupts get triggered on POS or NEG or ANY.
"it seems that it was just noise.... I guess.
I was able to solve it by converting the signal to 5v, then using a voltage divider and using the the new 3.3v signal which seems "cleaner" and now the interrupts get triggered on POS or NEG or ANY."
How did you convert signal ? Thanks David
Code used to setup the interrupt:
IDF version: latest idf github version as of January 5, 2017 Module used: Tested both on Sparkfun ESP32 Thing and DevKitC code:
scope results: The yellow signal represents the time the interrupt was generated. The blue signal represents the signal being read by GPIO.
With
POSEDGE
, it works as expected. WithNEGEDGE
, it is triggered both Rising and Falling. The Green circles represent the expected triggers. Red circles, the unexpected triggers.Full test is here: https://github.com/ricardoquesada/unijoysticle/blob/924a653f9a70ac0880541be58d8110c9ee9723a0/firmware/esp32/main/main.c
ANYEDGE
andNEGEDGE
behave the same way.