Hello, I have a problem with an interrupt that alarms itself for no reason.
This interrupt is handled by the encoder, it is connected to pin D4, as a knob press (spinning on pins D3 and D5). Encoder library. Everything was working fine until I included wifi operation in STA mode. After knocking out this code the problem persisted, I saw that esp was still connecting to the stored network despite knocking out the code, so I compiled the code with the wifi.mode(OFF) line and then my code again. The module stopped connecting, but still the interrupt alerts probably "every frame"(b. fast spam on serial monitor). There is no load in the interrupt, one line changing the value of a global variable of type uint8_t - that's it. Switching the interrupt to another pin makes it not work at all. I have a simple function that counts "frames" and normally it's close to 500,000 per second, but when I include encoder handling (checking every frame if there has been a state change, then ignoring the check if it hasn't been 50ms (debouncing) and rechecking the state after the noise) it drops to the console value, which is 30fps.
I tried an external 10kilo pullup, attached a 1000uF capacitor, disconnected the encoder from the pin, no change. I even checked with the arduino, the analogue pin and the drawing board in the arduino IDE (makeshift oscilloscope) what the state of the D4 pin on the esp looks like and it is ok, when I press the encoder it drops to about 60 (about 0.29V) and when I let go the state of the pin stays at one level without even special noise at about 680(3.32V) (arduino on 5V).
What could be the cause or what other data is needed.
This interrupt is handled by the encoder, it is connected to pin D4, as a knob press (spinning on pins D3 and D5). Encoder library. Everything was working fine until I included wifi operation in STA mode. After knocking out this code the problem persisted, I saw that esp was still connecting to the stored network despite knocking out the code, so I compiled the code with the wifi.mode(OFF) line and then my code again. The module stopped connecting, but still the interrupt alerts probably "every frame"(b. fast spam on serial monitor). There is no load in the interrupt, one line changing the value of a global variable of type uint8_t - that's it. Switching the interrupt to another pin makes it not work at all. I have a simple function that counts "frames" and normally it's close to 500,000 per second, but when I include encoder handling (checking every frame if there has been a state change, then ignoring the check if it hasn't been 50ms (debouncing) and rechecking the state after the noise) it drops to the console value, which is 30fps.
I tried an external 10kilo pullup, attached a 1000uF capacitor, disconnected the encoder from the pin, no change. I even checked with the arduino, the analogue pin and the drawing board in the arduino IDE (makeshift oscilloscope) what the state of the D4 pin on the esp looks like and it is ok, when I press the encoder it drops to about 60 (about 0.29V) and when I let go the state of the pin stays at one level without even special noise at about 680(3.32V) (arduino on 5V).
What could be the cause or what other data is needed.