Page 1 of 2
GPIO gives Multiple Interrupt events for single interrupt generation
Posted: Fri Apr 28, 2017 1:43 pm
by rahul.b.patel
Hello,
I have set several GPIOs for interrupt mode with Negative edge interrupt. In the ISR, I check the gpio level of respective GPIO. I am getting multiple times interrupt event for single interrupt generation (pressing push-button), getting gpio level '0' (using gpio_get_level()) first time and then level '1' for rest of the (bug) interrupt events, which are normally 2-3 times.
Can anyone have idea why I am getting multiple times interrupt event for single interrupt generation.? Push button is used to generate interrupt.
My configurations are as below:
int_type: GPIO_INTR_NEGEDGE,
pull_up: GPIO_PULLUP_ENABLE,
pull_down: GPIO_PULLDOWN_DISABLE. GPIOs 5,16,0 with ESP32 Dev kit. with ESP IDFv2.0.
Thank You.
Re: GPIO gives Multiple Interrupt events for single interrupt generation
Posted: Fri Apr 28, 2017 2:04 pm
by sintech
Contact bounce maybe?
Re: GPIO gives Multiple Interrupt events for single interrupt generation
Posted: Fri Apr 28, 2017 2:06 pm
by WiFive
Re: GPIO gives Multiple Interrupt events for single interrupt generation
Posted: Fri Apr 28, 2017 2:07 pm
by Ritesh
Hi,
I and Rahul are working together for this stuffs and we have used same gpio_test.c file from examples/periphirals/gpio section.
So, We have simply tested GPIO0 button which is on ESP32 Development Kit and have verified that we are getting multiple ISR calls with GPIO Level 0 and 1 for single press or release after settings Negative or Positive Edge Trigger.
Please let us know if anyone has any idea or is it still bug into ESP32-IDF 2.0 Official Release SDK.
Re: GPIO gives Multiple Interrupt events for single interrupt generation
Posted: Fri Apr 28, 2017 2:08 pm
by Ritesh
sintech wrote:Contact bounce maybe?
No, There is no any issue of contact Debounce as we have verified it into Arduino DUE board in which it is working fine without any issue after setting Negative or Positive Edge Trigger.
Re: GPIO gives Multiple Interrupt events for single interrupt generation
Posted: Fri Apr 28, 2017 2:11 pm
by Ritesh
We checked into Arduino DUE board in which it is working fine without any issue so it means no any issue of Switch Bounce or De-Bounce issue.
Re: GPIO gives Multiple Interrupt events for single interrupt generation
Posted: Fri Apr 28, 2017 3:01 pm
by martinayotte
Ritesh wrote:We checked into Arduino DUE board
Switches always have bounces, so don't rely on the fact that you were not able to reproduce the issue on DUE.
Check with an oscilloscope like shown on the article mentioned above.
Re: GPIO gives Multiple Interrupt events for single interrupt generation
Posted: Fri Apr 28, 2017 4:02 pm
by Ritesh
martinayotte wrote:Ritesh wrote:We checked into Arduino DUE board
Switches always have bounces, so don't rely on the fact that you were not able to reproduce the issue on DUE.
Check with an oscilloscope like shown on the article mentioned above.
Ok. We will check using CRO. But my concern is that we have used same mechanism like GPIO pull up and Negative Edge configurations for GPIO interrupt and getting multiple time interrupt for single press.
That is why I have compared with Arduino DUE as we checked same on that board which is working fine without any issue.
Re: GPIO gives Multiple Interrupt events for single interrupt generation
Posted: Fri Apr 28, 2017 4:24 pm
by Hubberthus
I'm not much of a HW guy, but my guess would be the speed. Maybe there is a bounce, but for the Due it's so fast it's negligible.
The ESP32 may "sample" a bit faster, so it gets more sensitive to that.
I'm just basing this on the clock speed.
But the oscilloscope will show everything though.
Re: GPIO gives Multiple Interrupt events for single interrupt generation
Posted: Fri Apr 28, 2017 4:48 pm
by Ritesh
Hubberthus wrote:I'm not much of a HW guy, but my guess would be the speed. Maybe there is a bounce, but for the Due it's so fast it's negligible.
The ESP32 may "sample" a bit faster, so it gets more sensitive to that.
I'm just basing this on the clock speed.
But the oscilloscope will show everything though.
Hi,
We are running our code into ESP32 with CPU clock speed as maximum 240 MHz while Arduino DUE is running into 86 MHz approximately.
Still we will check using CRO as well..