Are there any known issues of crosstalk between GPIO inputs?
I am using Python module RPi.GPIO to event detect on GPIO pins. One program monitors GPIO 2 pin 3 and the second program monitors GPIO 3 pin 5. I am using GPIO.event_detected to detect events within the programs. In the GPIO 2 monitor program, when GPIO 2 is pulled low, I get a trigger event for GPIO 2 and GPIO 3. In the GPIO 3 monitor program, when GPIO 3 is pulled low, I get a trigger event for GPIO 3 and GPIO 2.
I have seen this pattern of across three different Pi's. On two of Pi's the crosstalk is across GPIO 2, 3 & 4. After obtaining the same results across a Pi 2 & Pi 3, I opened a new Pi 3B+ never used and got similar results.
I am using the python script below substituting the pin 3 & pin 5.
# setup GPIO
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD) # set option to reference physical pins
# Set GPIO function
GPIO.setup(5, GPIO.IN, pull_up_down=GPIO.PUD_UP) # set GPIO input
GPIO.add_event_detect(5, GPIO.BOTH)
try:
while True:
if GPIO.event_detected(5):
print("5 Triggered")
except KeyboardInterrupt: # if ctrl+c pressed exit cleanly
GPIO.cleanup()
except: # this catches ALL other exceptions including errors.
GPIO.cleanup()
finally: # cleanup GPIO on normal exit
GPIO.cleanup()
My test cases target the suggestion, I have a bad Pi(s). I have extended this same test to three new Pi 3B+ just removed from the package and get the same results. All show crosstalk between GPIO 2,3 with some being GPIO 2, 3 & 4. This suggests I am at fault and not the Pi's.
Can anyone share their insight?
Sean