GPIO gives Multiple Interrupt events for single interrupt generation

rahul.b.patel
Posts: 59
Joined: Wed Apr 19, 2017 6:35 am

GPIO gives Multiple Interrupt events for single interrupt generation

Postby rahul.b.patel » Fri Apr 28, 2017 1:43 pm

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.

sintech
Posts: 27
Joined: Wed Dec 14, 2016 2:54 pm

Re: GPIO gives Multiple Interrupt events for single interrupt generation

Postby sintech » Fri Apr 28, 2017 2:04 pm

Contact bounce maybe?


Ritesh
Posts: 833
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: GPIO gives Multiple Interrupt events for single interrupt generation

Postby Ritesh » Fri Apr 28, 2017 2:07 pm

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.
Regards,
Ritesh Prajapati

Ritesh
Posts: 833
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: GPIO gives Multiple Interrupt events for single interrupt generation

Postby Ritesh » Fri Apr 28, 2017 2:08 pm

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.
Regards,
Ritesh Prajapati

Ritesh
Posts: 833
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: GPIO gives Multiple Interrupt events for single interrupt generation

Postby Ritesh » Fri Apr 28, 2017 2:11 pm

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.
Regards,
Ritesh Prajapati

User avatar
martinayotte
Posts: 118
Joined: Fri Nov 13, 2015 4:27 pm

Re: GPIO gives Multiple Interrupt events for single interrupt generation

Postby martinayotte » Fri Apr 28, 2017 3:01 pm

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.

Ritesh
Posts: 833
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: GPIO gives Multiple Interrupt events for single interrupt generation

Postby Ritesh » Fri Apr 28, 2017 4:02 pm

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.
Regards,
Ritesh Prajapati

Hubberthus
Posts: 6
Joined: Mon Feb 13, 2017 1:07 pm

Re: GPIO gives Multiple Interrupt events for single interrupt generation

Postby Hubberthus » Fri Apr 28, 2017 4:24 pm

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.

Ritesh
Posts: 833
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: GPIO gives Multiple Interrupt events for single interrupt generation

Postby Ritesh » Fri Apr 28, 2017 4:48 pm

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..
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: michelesolytic, p-rimes and 13 guests