Welp, 2 weeks later and it no longer works. The only change is in software: the UART is now interrupt driven.

The keyboard is controlled by a 6522 VIA. It generates an interrupt on a timer 60 times a second. Then the irq handler scans the keyboard through VIA port A.

The VIA seems to no longer be functioning. Interrupts aren’t firing. All registers return $C0, regardless of what I write to them.

Did the chip fail, or have I done something dumb?

#electronics #m6502 #homebrew #retrocomputing

Microsoft BASIC for 6502 Microprocessor - Version 1.1 , complete source code for Microsoft BASIC Version 1.1 for the 6502 microprocessor, originally developed and copyrighted by Microsoft in 1976-1978.

https://github.com/microsoft/BASIC-M6502/blob/main/m6502.asm
#asm #sourcecode #git #basic #history #it #assemblercode #m6502

Ok. I’m one baby step closer to a “keyboard driver”. I have validated that interrupts work on my system.

I configured a timer in the 6522 VIA to interrupt the processor 60 times/second. My interrupt handler just increments a 32-bit int and returns.

It works! I’m able to read the “u32” value and watch it change over time.

Now on to actual functionality! #m6502 #retrocomputing

I wrote a basic keyboard scanning routine for my #m6502 computer today. You hold a key down, run the routine, and then check a memory location for the scan code.

Next, I need to write an interrupt handler to do this scanning automatically.

#retrocomputing