Hello everyone,
I'm testing the gpio_example_main.c example, which indicates that some output pins must be connected to some input pins.
I've tested this example a long time ago without issues, but this time I'm having troubles when I do not connect the input pins. Every time I touch one of these input pins, their respective interrupts get triggered. This unexpected behaviour gets even worse when I connect a wire to the pins, whose interrupts get triggered when I approach my hand to the wire, just as they had some kind of capacitive nature.
First I thought it might be a matter of pull resistors so I used external ones without luck.
Is there something I'm missing here? Do you have any comment or suggestion?
Thanks a lot
Best regards
Verde
Interrupts triggered multiple times when pins are touched
-
- Posts: 8
- Joined: Wed Mar 13, 2019 9:49 pm
- Location: Lima, Peru
- Contact:
-
- Posts: 9766
- Joined: Thu Nov 26, 2015 4:08 am
Re: Interrupts triggered multiple times when pins are touched
The first bit is expected, as the pins indeed have a high impedance and will pick up random electromagnetic waves and trigger an interrupt that way. External pullups should, however, fix that issue... what resistors did you use and how, exactly, did you connect them?
-
- Posts: 8
- Joined: Wed Mar 13, 2019 9:49 pm
- Location: Lima, Peru
- Contact:
Re: Interrupts triggered multiple times when pins are touched
Hey there! Thanks for the reply!
I've been testing with internal and external(1K and 10K) pull resistors.
To be precise, I connected one resistor to each input pin of the example and VCC(3V3 of the dev board) or GND - pull-up and pull-down respectively.
I want to emphasize that the unexpected interrupt triggering only happens when the input signal is left disconnected. In other words, when you connect the pins just as the example indicates, there is no problem at all.
_________________________________________________________________________________
UPDATE
My finding about the correct operation of interrupts when using pull-ups was actually wrong. I tested the ESP32 in different places and its performance is not reliable when the input pins are connected to a free wire, which indicates that is indeed a capacitive behaviour.
Thanks a lot
Best regards
Verde
I've been testing with internal and external(1K and 10K) pull resistors.
In the case of external pull resistors, I used 1K and 10K resistors for testing.what resistors did you use and how, exactly, did you connect them?
To be precise, I connected one resistor to each input pin of the example and VCC(3V3 of the dev board) or GND - pull-up and pull-down respectively.
I want to emphasize that the unexpected interrupt triggering only happens when the input signal is left disconnected. In other words, when you connect the pins just as the example indicates, there is no problem at all.
_________________________________________________________________________________
UPDATE
My finding about the correct operation of interrupts when using pull-ups was actually wrong. I tested the ESP32 in different places and its performance is not reliable when the input pins are connected to a free wire, which indicates that is indeed a capacitive behaviour.
Thanks a lot
Best regards
Verde
Last edited by karlo.verde.13 on Sat Mar 16, 2019 1:56 am, edited 1 time in total.
Re: Interrupts triggered multiple times when pins are touched
Do you have a bounce problem? Have you looked at it on a scope? Are you debouncing?
IT Professional, Maker
Santiago, Dominican Republic
Santiago, Dominican Republic
-
- Posts: 8
- Joined: Wed Mar 13, 2019 9:49 pm
- Location: Lima, Peru
- Contact:
Re: Interrupts triggered multiple times when pins are touched
Actually, that's something I haven't tried yet because I considered this issue a matter of pull resistors to ensure a known state of the input signal. Plus, considering the use of these resistors, in my experience, this "capacitive" behaviour is shown when the resistance value is quite high. However, if I am wrong, I would appreciate if someone could point out how debouncing is generating this erratic response.
Thanks a lot
Best regards
Verde
Re: Interrupts triggered multiple times when pins are touched
Pulling it up will make it clearly High as compared to "Floating high" .
But, if you have a switch on that pin (andit is pulled high) twhen closed will make it low (pin to switch to ground) when you make that switch the signal will bounce and finally settle at low. You need to debounce in software; you can debounce in h/w too.
But, if you have a switch on that pin (andit is pulled high) twhen closed will make it low (pin to switch to ground) when you make that switch the signal will bounce and finally settle at low. You need to debounce in software; you can debounce in h/w too.
IT Professional, Maker
Santiago, Dominican Republic
Santiago, Dominican Republic
Who is online
Users browsing this forum: No registered users and 162 guests