Hi Dan,
I have to admit, I did that code 15 years ago so I'm pretty rusty on the details. You do need to send some initialization commands to the keyboard if I recall. Some of that is used to set the LED's in a known state.
I do not recall the AA, but that is binary '10101010', which could be telling us something. I've got a lot on my plate currently, but maybe I can dig up some free time on Saturday to refresh myself with the code and could then offer some suggestions.
In the mean time, if you are better with 6502 assembly, you could connect the keyboard directly to the 6522 and use my 6502 code to test the keyboard using this project:
http://sbc.rictor.org/pckb6522.htmlDaryl
_________________
Please visit my website ->
https://sbc.rictor.org/