Problems with the 6502 at higher clock speed
Hello! So I explain it in the video but ill provide a summary here. I completed the LCD integration and the RAM installation and those both seemed to work. However when I tried to run it with the 1MHz oscillator instead of using my arduino it didn't. After a lot of troubleshooting I've stripped away as many potential sources of error as I can and im just using the 6502, 6522, and the EEPROM. Ive made a program (below) that just blinks lights super slowly, going into a long loop after each ror command. At 40KHz from the arduino it works fine, but at 50KHz it is unstable, stopping at random points. above that it doesn't turn on any lights, and connecting it to the 1MHz oscillator doesn't work either.
EDIT: just to clarify, the instruction pointer initalization vector is at 9ffc because I am using a smaller EEPROM (8K). I broke the one that came with the kit
I have no idea what the issue could be, it could obviously be with my arduino nano but everything I can find says that 50KHz should be no problem for it. That would mean I also have a separate problem with my 1MHz crystal though.
.
org $8000
PORTA = $6001
PORTB = $6000
reset
:
lda
#$ff ; Set all to outputs on A
sta
$6002
clc
lda
#$01
loop
:
ror
sta
PORTB
; blink
jmp
wait
wait
:
ldx
#$10
wait_loop_x
:
ldy
#$ff
wait_loop_y
:
dey
bne
wait_loop_y
dex
bne
wait_loop_x
jmp
loop
.
org $9ffc
.
word reset
.
word $0000
.org $8000
PORTA = $6001
PORTB = $6000
reset:
lda #$ff ; Set all to outputs on A
sta $6002
clc
lda #$01
loop:
ror
sta PORTB ; blink
jmp wait
wait:
ldx #$10
wait_loop_x:
ldy #$ff
wait_loop_y:
dey
bne wait_loop_y
dex
bne wait_loop_x
jmp loop
.org $9ffc
.word reset
.word $0000
```
```