Troubleshooting Random Address Jumps on 6502 with Raspberry Pi

I am using a Raspberry Pi to monitor the 6502 pin outputs, and I can see that the address jump is random and not continuous. Is there any problem with using the Raspberry Pi? Can anyone please tell me what the issue is?

Output:

1110101011101010 eaea 11101010 ea r

1110101011101011 eaeb 11101010 ea r

1110101011101011 eaeb 11101010 ea r

1110101011101110 eaee 11101010 ea r

1110101011101110 eaee 11101010 ea r

1110101011101111 eaef 11101010 ea r

1110101011101111 eaef 11101010 ea r

1110101011101110 eaee 11101010 ea r

1110101011101110 eaee 11101010 ea r

1110101011101111 eaef 11101010 ea r

1110101011101111 eaef 11101010 ea r

1110101011110010 eaf2 11101010 ea r

1110101011110010 eaf2 11101010 ea r

1110101011110011 eaf3 11101010 ea r

1110101011110011 eaf3 11101010 ea r

1110101011110010 eaf2 11101010 ea r

1110101011110010 eaf2 11101010 ea r

python code:

import RPi.GPIO as GPIO

from time import sleep, time

DEBOUNCE_TIME = 0.01 # 10 ms debounce time

try:

GPIO.setmode(GPIO.BCM)

ADDRESS_PINS = [

2, 3, 4, 17, 27, 22, 10, 9, 11, 0, 5, 6, 13, 19, 21, 20

]

ADDRESS_PINS.reverse()

DATA_PINS = [

23, 24, 25, 8, 7, 1, 12, 16

]

DATA_PINS.reverse()

CLOCK_PIN = 26

READ_WRITE = 18

for pin in ADDRESS_PINS:

GPIO.setup(pin, GPIO.IN)

for pin in DATA_PINS:

GPIO.setup(pin, GPIO.IN)

GPIO.setup(CLOCK_PIN, GPIO.IN)

GPIO.setup(READ_WRITE, GPIO.IN)

last_clock_state = GPIO.LOW

last_debounce_time = 0

try:

while True:

current_clock_state = GPIO.input(CLOCK_PIN)

current_time = time()

if current_clock_state == GPIO.HIGH and last_clock_state == GPIO.LOW:

if (current_time - last_debounce_time) > DEBOUNCE_TIME:

states0 = []

address = 0

for pin in ADDRESS_PINS:

bit = 1 if GPIO.input(pin) == 1 else 0

states0.append(str(bit))

address = (address << 1) + bit

print("".join(states0), f"{address:04x}", end=" ")

states1 = []

data = 0

for pin in DATA_PINS:

bit = 1 if GPIO.input(pin) == 1 else 0

states1.append(str(bit))

data = (data << 1) + bit

print("".join(states1), f"{data:02x}", end=" ")

rw = 'r' if GPIO.input(READ_WRITE) == 1 else 'w'

print(rw)

last_debounce_time = current_time

last_clock_state = current_clock_state

except KeyboardInterrupt:

print("\nExiting... Cleaning up GPIO.")

GPIO.cleanup()

except Exception as err:

print(f"Error: {err}")

GPIO.cleanup()