don't use any, you might have missed that I added
OK, well, I tried a few combinations, but at the end of the day, the jitter appears no matter what I do.
I tried pulling up with a 100 ohm resistor (yes, I know there's an internal pull up but I am trying anything that might help. As you mentioned, its a pretty feeble pull up onboard.)
At least your bit of code shows it is nothing to do with interrupts as such. But instead, some kind of voltage jitter on the pins.
Time to try other pins I think. Maybe something from the other side of the chip.
can you confirm the button is connected in the right way (in diagonal) ?
Same behaviour on pins 25 and 26.
I wonder if it is an issue specific to either these chips (both the same type and bought at the same time) or something to do with the power supply. (A HP Elitedesk USB port.)
Next step... I think I have an Arduino of some sort bought from Jaycar. I will test it. That should eliminate some variables.
that's weird - my ESP32-WROOM-32 just works fine on any suitable pin.
did you by any "chance" damage your pins ?
how long is your wire from pin 18 to the button ?
Can you successfully light a led connected to gpio18 (with appropriate series resistor) just to check the pin works and you are interpreting the board labeling correctly.
One thing we don’t have here is a wiring diagram - power supply ? Length of leads to switch , anything else connected . Something is wrong here .
Are you sure you are looking at the correct pin - PIN numbers are not the same as I/o numbers . Check carefully some pins are reserved for certain functions .( eg gpio 100, in 27)
Pin 18 for example is I/0 10.
I know you want interrupts , but purely as a test, just try a digital read to start with to check out your hardware and eliminate that side of things .
A floating pin will trigger randomly , that is normal .
No mechanical damage, it would have to be electronic. And one of the chips was fresh from the little anti-static bag.
Various fly leads, from 5cm to 10cm.
Yes, to both. Tested with a LED and I am crystal clear on the pin assignments. (Although I may need glasses soon.)
Absolutely nothing connected to the chips. No other leads, nothing. Just powered by the USB port of my HP Elitedesk mini pc.
Crystal clear on the pins.
J-M-L's code eliminated interrupts as the problem.
According to the documentation, using the INPUT_PULLUP mode makes the pin non-floating. But the point is, the problem does not start until the fly lead is connected.
And pulling the pin up manually makes no difference.
Just as an aside...
So far this chip is doing a whole lot of other minor module tasks well. It is talking to a MPU9265 perfectly. It is controlling a DC motor through a MD20A H Bridge and it is able to do position sensing with a voltage divider circuit.
None of these other components are connected during testing, but all are working well.
This issue seems isolated to something to do with detecting the FALLING state of a pin that has been pulled up. Perhaps it is time for me to flip the code and try RISING on a pin that has been pulled down...
I am unable to reproduce your observations; rather my interrupt is working fine! There is no multiple triggering!!
1. I have read your post #1.
2. I have made the setup using 30-pin ESP32 Dev. Kit (Fig-1) as per circuit diagram given in your referred link.
Figure-1:
3. I have uploaded the sketch that has been in the referred link.
struct Button {
const uint8_t PIN;
volatile uint32_t numberKeyPresses;
volatile bool pressed;
};
Button button1 = { 18, 0, false };
void IRAM_ATTR isr() {
button1.numberKeyPresses++;
button1.pressed = true;
}
void setup() {
Serial.begin(115200);
pinMode(button1.PIN, INPUT_PULLUP);
attachInterrupt(button1.PIN, isr, FALLING);
}
void loop() {
if (button1.pressed) {
Serial.printf("Button has been pressed %u times\n", button1.numberKeyPresses);
button1.pressed = false;
}
}
4. Output on Serial Monitor
15:21:27.310 -> Button has been pressed 1 times
15:21:27.654 -> Button has been pressed 2 times
15:21:29.441 -> Button has been pressed 3 times
15:21:29.599 -> Button has been pressed 4 times
4. I suspect youre messy wiring and not putting a Button (the interrupting device) and not using the 30-pin ESP32 Dev. Kit as suggested in the link you ave referred.
It is not messy wiring.
I am powering it directly from the USB cable into the micro USB port. No other inputs.
This has worked perfectly for every other aspect of the project.
Are you saying it needs another power source?
Show a picture of your setup. Are you using the 30-pin ESP32 Dev. Kit as suggested in the referred link? If not, what are you using? You have said in your post #1 -- "ESP32-WROOM-32 chip". What does it mean?
you did not answer that one (I suspect you know what you are doing but just in case)
I am not using that sort of button.
Just a rather nice two pin version.
Eliminates one variable.
The label in my first post is the chip I am using.
One of those button pins is connected to the chosen ESP32 GPIO pin and the other is connected to a common ground ?


